Copyright (c) 2011 Doron Katz. All rights reserved. DoronKatz registered under ABN 68 954 062 611. Apple, the Apple logo, iPod, iPod touch, and iTunes are trademarks of Apple Inc., registered in the U.S. and other countries. iPhone is a trademark of Apple Inc. App Store is a service mark of Apple Inc. Theme by Cory Watilo

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