Friday, September 23, 2011

Methods Invoked in Life Cycle of Components

addChild : is called on parent container .
*sets the parent property of the component.
*Computes style Settings.

Preinitialize: The application has been instantiated but has not yet created any child components.

CreateChildren:Flex calls the createChildren() method in response to the call to the addChild() method to add the component to its parent.

invalidateProperties(): marks a component so that its commitProperties() method gets called during a later screen update.

invalidateSize (): Marks a component so that its measure() method gets called during a later screen update.

invalidateDisplayList (): Marks a component so that its updateDisplayList() method gets called during a later screen update.

Initialize: The application has created child components but has not yet laid out those components.

CommitProperties:Flex calls the commitProperties() method when you use the addChild() method to add a component to a container, or when you call the invalidateProperties() method of the component. Calls to the commitProperties() method occur before calls to the measure() method. This lets you set property values that might be used by the measure() method.
Calls the component’s measure() method.

Measure : calculates the default size, and optionally the default minimum size, of the component. This is an advanced method that you might override when creating a subclass of UIComponent.
The default implementation of measure() sets measuredWidth, measuredHeight, measuredMinWidth, and measuredMinHeight to 0.

LayoutChrome:Calls the component’s (Adobe help mention this method is in UIComponent where as it is in container class) container’s layoutChrome() method.
The Container class, and some subclasses of the Container class, use the layoutChrome() method to define the border area around the container.
Calls the component’s updateDisplayList() method.

UpdateDisplayList(): method sizes and positions the children of your component based on all previous property and style settings, and draws any skins or graphic elements that the component uses. The parent container for the component determines the size of the component itself.

UpdateComplete ispatched when an object has had its commitProperties(), measure(), and updateDisplayList() methods called (if needed). This is the last opportunity to alter the component before it is displayed. All properties have been committed and the component has been measured and layed out.

creationComplete: The application has been completely instantiated and has laid out all components.

No comments:

Post a Comment