Notes on Java, Solaris, PHP, LDAP…

July 20, 2009

Error blackhole in Adobe Flex or SWF player

Filed under: Uncategorized — negev @ 1:34 pm
Tags:

So you have an Adobe Flex application that uses GUI states. You get back to it after a longer period, and you need to fine-tune details. You need to set initial properties of some GUI controls for some situations. You already had an initialization function, so you just do it there. Then you run it, and the code just stops where you changed it. No error and no execution. You try the debug SWF player, same thing.

That’s when you access a GUI control, which wasn’t created yet. It happens if your control is added in a GUI state, but the component didn’t enter that state yet. Like if in the following you want to set contactMe.selected before you switch your component to “extendedForm“.

<mx:states>
<mx:State name=”extendedForm”>
<mx:AddChild position=”lastChild”>
<mx:CheckBox id=”contactMe” x=”10″ y=”216″ label=”Would you like us to contact you about our new products? Maximum 4 times a year.” />
</mx:AddChild>
</mx:State>
</mx:states>

Adobe Flex or SWF player should really report this as a null exception or some other meaningful error.

I reported it at Flex bugs site.

Blog at WordPress.com.