Specifications

107ADOBE FLEX 3
Building and Deploying Adobe Flex 3 Applications
addToCreationQueue('redBox', 4);
addToCreationQueue('blueBox', 2);
addToCreationQueue('whiteBox', 1);
addToCreationQueue('greenBox', 3);
}
Combining containers with different creationPolicy settings
You can mix containers with different creationPolicy settings and change the order in which they are created
and their children are displayed. Flex creates outer containers before inner containers, regardless of their
creationIndex. This is because Flex does not create the children of a queued container until all containers at that
level are created.
Setting a container’s
creationPolicy property does not override the policies of the containers within that
container. For example, if you queue an outer container, but set the inner container’s
creationPolicy to none,
Flex creates the inner container, but not any child controls of that inner container.
In the following example, the button1 control is never created because its container specifies a creationPolicy
of
none, even though the outer container sets the creationPolicy property to all:
<?xml version="1.0"?>
<!-- layoutperformance/TwoCreationPolicies.mxml -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
<mx:HBox label="HBox1" creationPolicy="all" creationIndex="0">
<mx:HBox label="HBox1" creationPolicy="none">
<mx:Button id="button1" label="Click Me"/>
</mx:HBox>
</mx:HBox>
</mx:Application>
Using the callLater() method
The callLater() method queues an operation to be performed for the next screen refresh, rather than in the
current update. Without the
callLater() method, you might try to access a property of a component that is not
yet available. The
callLater() method is most commonly used with the creationComplete event to ensure
that a component has finished being created before Flex proceeds with a specified method call on that component.
All objects that inherit from the UIComponent class can open the callLater() method. It has the following
signature:
callLater(method:Function, args:Array):void