Flex 3: Delaying Instantiation to Improve Startup Time with Components

This tutorial is inspired by the book Flex 3 Cookbook  

A quick tip to ensure components render in your Flex application, only when needed for display. You work with the creationPolicy property of the Container class. 

By default, Flex creates components only when they are displayed in the mxml, which infers the creationPolicy is set to auto.  You can either leave it at default, or use:
  • none – no components created.
  • all – all components will be created, and queued, based on their creationIndex

To illustrate this, the chapter shows a ComboBox sample snippet: 


...
<mx:Script>
[![CDATA[
  
   private function changeViewStackCreation(): void {
    viewStack.creationPolicy = all;
viewStack.createComponentsFromDescriptors(true);
  }
..

You can find more by buying this book for only £24.54
Advertisements
This entry was posted in Adobe Technologies, General and tagged , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s