Friday, August 26, 2011

About Flex4.5 creationPolicy

Containers define a creation policy that specifies when its children are created. By default, a container delays creating its children until they are needed by the application. This process is called deferred instantiation. Since all children are not created at application start up, your application appears to run faster.

You can control the creation policy for a container. For example, you can create all children at startup, or you can explicitly determine when a child is created.

You can use the following creation policies:
  • ContainerCreationPolicy.AUTO 
    • The container delays creating children until they are needed.
    • For navigator containers such as the MX ViewStack, MX TabNavigator, and MX Accordion containers, the container creates its direct children immediately, but waits to create the descendants of each child until the child needs to be displayed. As a result, only the initially required child or children of a container get processed past the preinitialization stage. An auto creation policy produces the best startup time because fewer components are created initially.
  • ContainerCreationPolicy.ALL
    • All container children are created and initialized before the container is initialized.
  • ContainerCreationPolicy.NONE
    • Requires the container to explicitly create every child instance.

For detailed information on creation policies, see Improving startup performance.

No comments:

Post a Comment