As part of my work, I\’ve been developing a Flash-based software training application. Part of that app involves simulations of the application in question. Yesterday, I discovered a bug in the way the combo box component works. I\’m posting this for the benefit of those who might be wasting their time searching for an answer, as I did find one after wasting much of my own time.
Macromedia Flash MX 2004 includes \”components\” (which are, in Visual Basic terminology, \”controls\” or in Linux terminology, \”widgets\”). So, instead of building a button or combo box from scratch (as you had to in previous versions), you can use a pre-compiled component supplied with that app and just drag it onto the stage.
Fine and dandy. The problem occurs when you create a modular app, as you should, that loads movie clips dynamically. So, for instance, you have the main SWF which contains a blank movie clip that, when necessary, loads other SWF files. In my case, a button on the main/parent file loads two other child SWF files into blank movie clips to simulate a popup window. If the child SWF contains a combo box, it will not work when loaded into the parent SWF\’s blank movie clip (even though it will work if you test the file on its own).
The solution defies all logic, but it works. Create a second combo box, but put it somewhere in the parent SWF. Give it the same instance name as the combo box in the child SWF. Test it out. Viola. The combo box on the child SWF now works. Your last step is to hide the useless combo box on in the parent SWF or find a way to set its visibility so that it doesn\’t appear. Note: the combo box in the parent file does not have to be an exact copy of the one in the child file, it merely has to share the instance name for the fix to work.
I found this fix here, in the comments to the Flash MX 2004 livedocs.