Specifications

103ADOBE FLEX 3
Building and Deploying Adobe Flex 3 Applications
<mx:Button id="button2b" label="Button 2B"/>
</mx:Panel>
<mx:Panel id="panel3" creationPolicy="queued" width="100%" height="33%">
<mx:Button id="button3a" label="Button 3A"/>
<mx:Button id="button3b" label="Button 3B"/>
</mx:Panel>
</mx:Application>
Flex first creates all the panels. Flex then instantiates and displays all the children in the first panel in the queue
before moving on to instantiate the children in the next panel in the queue.
To specify an order for the containers in the instantiation queue, you use the
creationIndex property. For more
information on using the
creationIndex property, see Setting queue order” on page 103.
Setting queue order
When you use ordered creation, the order in which containers appear in the instantiation queue determines in
what order Flex displays the container and its children on the screen.
You can set the order in which containers are queued by using the containers
creationIndex property, in
conjunction with setting the
creationPolicy property to queued. Flex creates the containers in their
creationIndex order until all containers in the initial view are created. Flex then revisits each container and
creates its children in the same order. After creating all the children in a container that is in the queue, Flex
displays that container before starting to create the children in the next container.
All containers support a
creationIndex property.
If you set a
creationIndex property on a container, but do not set the creationPolicy property to queued, Flex
ignores the
creationIndex property and uses auto, the default value, for the creationPolicy property.
The following example sets the
creationIndex property so that the contents of the panel3 container are shown
first, then the contents of panel2, and finally the contents of panel1:
<?xml version="1.0"?>
<!-- layoutperformance/QueueOrder.mxml -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
<mx:Script><![CDATA[
private function logCreationOrder(e:Event):void {
ta1.text += e.currentTarget.id + " created\n";
}
]]></mx:Script>
<mx:Fade id="SlowFade" duration="4000"/>
<mx:HBox>