Specifications
105ADOBE FLEX 3
Building and Deploying Adobe Flex 3 Applications
addToCreationQueue(id:Object, preferredIndex:int, callbackFunction:Function,
parent:IFlexDisplayObject):void
The following table describes the addToCreationQueue() method’s arguments:
Only use the addToCreationQueue() method to add containers to the queue whose creationPolicy property
is set to
none. Containers whose creationPolicy property is set to auto or all will probably created their
children during the application initialization. Containers whose
creationPolicy property is set to queued are
already in the queue.
After it is added to the queue, the container that is to be created with the
addToCreationQueue() method then
competes with containers whose
creationPolicy is set to queued, depending on their position in the queue.
Flex creates containers whose
preferredIndex property is lowest.
The following example uses the
addToCreationQueue() method to create the children of the HBox containers
when the user clicks the Create Later button. The calls to the
addToCreationQueue() method specify a
preferredIndex for each box, which causes the boxes and their children to be created in a different order from
the order in which they are defined in the application’s source code (in this example, box1, box3, box2, and then
box4).
<?xml version="1.0"?>
<!-- layoutPerformance/AddToCreationQueueExample.mxml -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
<mx:Script><![CDATA[
public function doCreate():void {
addToCreationQueue('box1', 0);
addToCreationQueue('box2', 2);
addToCreationQueue('box3', 1);
addToCreationQueue('box4', 3);
}
]]></mx:Script>
<mx:HBox backgroundColor="#CCCCFF" horizontalAlign="center">
<mx:Label text="addToCreationQueue()" fontWeight="bold"/>
</mx:HBox>
Argument Description
id
Specifies the name of the container that you want to add to the queue.
preferredIndex
(Optional) Specifies the container’s position in the queue. By default, Flex places the container at the end
of the queue, but this value lets you explicitly choose the queue order for the container.p
callbackFunction
This parameter is currently ignored.
parent
This parameter is currently ignored.










