Specifications
CHAPTER 5
104
<mx:Panel id="panel1" title="Panel 1 (index:2)" creationPolicy="queued"
creationIndex="2" creationComplete="logCreationOrder(event)"
creationCompleteEffect="{SlowFade}">
<mx:Button id="button1a" label="Button 1A"
creationComplete="logCreationOrder(event)"/>
<mx:Button id="button1b" label="Button 1B"
creationComplete="logCreationOrder(event)"/>
</mx:Panel>
<mx:Panel id="panel2" title="Panel 2 (index:1)" creationPolicy="queued"
creationIndex="1" creationComplete="logCreationOrder(event)"
creationCompleteEffect="{SlowFade}">
<mx:Button id="button2a" label="Button 2A"
creationComplete="logCreationOrder(event)"/>
<mx:Button id="button2b" label="Button 2B"
creationComplete="logCreationOrder(event)"/>
</mx:Panel>
<mx:Panel id="panel3" title="Panel 3 (index:0)" creationPolicy="queued"
creationIndex="0" creationComplete="logCreationOrder(event)"
creationCompleteEffect="{SlowFade}">
<mx:Button id="button3a" label="Button 3A"
creationComplete="logCreationOrder(event)"/>
<mx:Button id="button3b" label="Button 3B"
creationComplete="logCreationOrder(event)"/>
</mx:Panel>
</mx:HBox>
<mx:TextArea id="ta1" height="200" width="350"/>
</mx:Application>
This example uses the inherited creationCompleteEffect effect to play an effect just as the container finishes
creation. The result is that the panels fade in slow enough that you can see the order of creation. After a container
is initialized and displayed, Flex waits for all effects to finish playing before initializing the next container.
If you set the same value of the
creationIndex property for two queued containers, Flex creates and displays
their contents in the order in which they are defined in the application’s source code. The value of the
creationIndex property can be any valid Number, including 0 and negative values.
Dynamically adding containers to the queue
You can dynamically add containers to the instantiation queue by using the Application class’s addToCreation-
Queue()
method. The addToCreationQueue() method has the following signature:










