I am having trouble understanding how to use deferred instantiation.

I have a project with a viewstack, and the viewstack has a lot of canvas 
containers for different "pages" that are activated according to user selection 
on a menubar.  Each "page" inside the canvas is actually one or two components.

The problem is that each of these components has some custom code attached to 
the creationComplete event that loads external string files. What I am seeing 
is that all containers and the components are initializing when the application 
loads, and all string files are being loaded, regardless of the current 
viewstack view.  This is creating a serious performance problem.

To test the child controls, I added some alerts inside the "page" components as 
well (such as a label) that are attached to creationComplete and addedToStage.  
Both events are firing when the app loads, for all viewstack containers.

I don't understand this.  What exactly is being deferred?

Do all components/child components/controls go through the initialization 
process and fire creationComplete, regardless of whether they are visible?

Can someone please enlighten me on how to use this correctly?






Reply via email to