Hi, I am new to flex. I am confused with how component life cycle goes when component build in MXML. and if MXML calls methods automatically then how to call any method in life cycle explicitly.
Could anybody please explain me
Thanks Shruti
Hi, I am new to flex. I am confused with how component life cycle goes when component build in MXML. and if MXML calls methods automatically then how to call any method in life cycle explicitly.
Could anybody please explain me
Thanks Shruti
Go read this document:
Basically the Components life cycle is:
Constructor > createChildren() > updateDisplayList() or measure() or commitProperties()
Your implementation of createChildren() will get called when your Component gets added to the stage.
Your implementation of the "update" methods (i.e. updateDisplayList(), measure(), or commitProperties()) will get called during initialization and by the framework as needed later.
The framework calls an update method when one of the "invalidate" methods (i.e. invalidate(), invalidateDisplayList(), invalidateSize() or invalidateProperties()) is called. You can have your update method called explicitly by calling the appropriate invalid method. The framework does not call update methods immediately when you invalidate. Instead it waits until later on when there is time to update the screen. If you want to force the update to happen immediately, call "validateNow()".