Macromedia Components & Object.prototype Don’t Get Along
Categories: Flash
In most of my flash projects I have a prototype file I include into the project. It contains additions to core objects such as Object, MovieClip, etc. Well, today I found out that some Macromedia components (ComboBox was the one I was having trouble with) don’t like additional methods to be defined on certain classes (Object was the one I found that ComboBox was having issues with); they fail to continue to work with additional methods defined.
However, there is a workaround: ASSetPropFlags. Simply hide all additional methods with this line of code: [code lang=”actionscript”]ASSetPropFlags(Object.prototype, null, 1);[/code]
I can’t wait until AS3 can be used all the time.
I haven’t quite got my head around ASSetPropFlags yet. This is exactly what I was looking for.
For the record, here are the components I have had this problem with:
mx.controls.List
mx.controls.ComboBox
mx.controls.Menu
I haven’t dug into what’s causing it since the EULA forbids us from distributing patches anyway. This workaround seems fine so far.
Thanks 🙂