PDA

View Full Version : Extremely weird combo box bug found... and resolved


pmineault
10-15-2004, 03:12 AM
Here's a little warning for you application creators. There's a very weird bug in combobox where it will stop working properly if you add a method to the Object prototype. For example, you can try placing this in your first frame:

Object.prototype.anythingatall = function(){ }

Now drop an instance of ComboBox on stage and add three different values in the labels array to it. Now test your movie. The first value appears. Click on the combobox, it works. Now select a value. Click on it again. All values have been replaced with the first label. Now select a new value. Click again to open the combo box. All values are simultaneously selected!

I discovered the bug while developping a very large application (2000+ lines of code), and it took me quite a while to find out what the source is. Hope this is useful to someone.

farafiro
10-18-2004, 09:55 AM
wow, very strange

thanks for the info pmineault

gravenine
08-04-2005, 06:57 AM
I just had this same exact thing happen. Frustrating as all hell. Have you found out what it might be?

madgett
08-04-2005, 07:43 AM
The combobox in V2 components is developed upon inheritance. It loops through objects to retrieve data and properties, so when you add a prototype to the Object class from which stems everything, you are adding an extra parameter in every object in your flash movie and if the component or movie clip expects a certain number of parameters and you add 1 extra one then it pulls a chain reaction on all levels of inheritance. Specifically on components that use a DataProvider array object.

With that in mind I usually make subclasses instead of prototyping. In the end it might take longer but I think it's a good habit.

gravenine
08-04-2005, 05:28 PM
Do you know of any good tutorials on subclassing? Or can you provide a quick and dirty example? I'm familliar with the concept, but not the syntax.

Thanks

sleekdigital
08-04-2005, 06:15 PM
Check out "extends" in the flash help for starters.

http://livedocs.macromedia.com/flash/mx2004/main_7_2/wwhelp/wwhimpl/common/html/wwhelp.htm?context=Flash_MX_2004&file=00001347.html

neurotick
08-08-2005, 08:27 AM
I've had another bug with the combobox what's a bit more subtle. I added a combobox to my application and once running, if I used the combobox, all of the rollover and press actions on my custom mc's were glitchy. fyi.

sleekdigital
08-08-2005, 02:05 PM
I'm pretty sure this is something specific to your code rather than a bug in the combobox. Plenty of folks have used comboboxes without the problem you describe.