By default, Viewstack creates all of its children, but those children do not 
create their children unless they are the selectedChild.  You can hook up to 
the creationComplete of one of those grandchildren.

Alex Harui
Flex SDK Developer
Adobe Systems Inc.<http://www.adobe.com/>
Blog: http://blogs.adobe.com/aharui

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On Behalf 
Of Wesley Acheson
Sent: Monday, September 14, 2009 1:23 PM
To: flexcoders@yahoogroups.com
Subject: Re: [flexcoders] Don't understand how to use deferred instantiation



http://livedocs.adobe.com/flex/3/html/help.html?content=layoutperformance_05.html

Have you tried setting the creation policy?  Jake It says on the above page 
that viewStack defers child creation by default.

Regards,

Wesley Acheson
On Mon, Sep 14, 2009 at 9:17 PM, Jake Churchill 
<j...@cfwebtools.com<mailto:j...@cfwebtools.com>> wrote:


Yes, a viewstack loads everything when the app loads.  If you don't want that, 
I think you need to use states instead



Jake Churchill
CF Webtools
11204 Davenport, Ste. 100
Omaha, NE  68154
http://www.cfwebtools.com
402-408-3733 x103

From: flexcoders@yahoogroups.com<mailto:flexcoders@yahoogroups.com> 
[mailto:flexcoders@yahoogroups.com<mailto:flexcoders@yahoogroups.com>] On 
Behalf Of biosmonkey
Sent: Monday, September 14, 2009 1:49 PM
To: flexcoders@yahoogroups.com<mailto:flexcoders@yahoogroups.com>
Subject: [flexcoders] Don't understand how to use deferred instantiation





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?

No virus found in this incoming message.
Checked by AVG - www.avg.com<http://www.avg.com>
Version: 8.5.409 / Virus Database: 270.13.96/2369 - Release Date: 09/14/09 
05:51:00



Reply via email to