Idealism is what precedes experience; cynicism is what follows...

Saturday, June 14, 2008

Adobe Flex : Never try to manipulate the children components from the ActionScript constructor

This is a common mistake made by developers using this pattern. For example, you try to set the button label in the constructor. If you tried this you would get a null value error for the button since it has not been created yet. MXML creates the children components in the initialize() phase so the best way to work around this is to override initialize(), call super.initialize() first and then you can start accessing children components.

No comments:

Blog Archive

My Network