Specifications

95ADOBE FLEX 3
Building and Deploying Adobe Flex 3 Applications
Single-view containers
Single-view containers by default create all their children when the application first starts. You can use the
creationPolicy property to change this behavior. The following table describes the values of the
creationPolicy property when you use it with single-view containers:
The following example sets the value of a VBox containers creationPolicy property to auto, the default value:
<?xml version="1.0"?>
<!-- layoutperformance/AutoCreationPolicy.mxml -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml">
<mx:VBox id="myVBox" creationPolicy="auto">
<mx:Button id="b1" label="Get Weather"/>
</mx:VBox>
</mx:Application>
The default behavior of all single-view containers is that they and their children are entirely instantiated when the
application starts. If you set the
creationPolicy property to none, however, you can selectively instantiate
controls within the containers by using the techniques described in Creating deferred componentson page 98.
Multiple-view containers
Containers with multiple views, such as the ViewStack and Accordion, do not immediately create all of their
descendants, but only those descendants that are visible in the initial view. Flex defers the instantiation of descen-
dants that are not initially visible until the user navigates to a view that contains them. The following containers
have multiple views and, so, are defined as navigator containers:
ViewStack
Ta b Nav i g ator
Accordion
Value Description
all, auto Creates all controls inside the single-view container. The default value is auto, but all results in the same behavior.
none
Instructs Flex to not instantiate any component within the container until you manually instantiate the controls.
When the value of the creationPolicy property is none, explicitly set a width and height for that container.
Normally,
Flex scales the container to fit the children that are inside it, but because no children are created, proper
scaling is not possible. If you do not explicitly resize the container, it grows to accommodate the children when they
are created.
To manually instantiate controls, you use the createComponentsFromDescriptors() method. For more
information, see
“Creating deferred components” on page 98.
queued
Has no effect on deferred creation. For more information on using the queued value of the creationPolicy prop-
erty, see “Using ordered creation” on page 101.