That's not true. It only loads everything when the app loads if
creationPolicy is set to all . (
http://livedocs.adobe.com/flex/3/langref/mx/core/Container.html#creationPolicy
).
I suggest that the original poster check the creationPolicy for his
viewStack. If none is set, move up the component chain to the main
application file. Most likely someone somewhere set it to All (
|ContainerCreationPolicy.ALL ). |
Jake Churchill 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 <http://www.cfwebtools.com>
402-408-3733 x103
*From:* flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com]
*On Behalf Of *biosmonkey
*Sent:* Monday, September 14, 2009 1:49 PM
*To:* 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
Version: 8.5.409 / Virus Database: 270.13.96/2369 - Release Date:
09/14/09 05:51:00
--
Jeffry Houser, Technical Entrepreneur
Adobe Community Expert: http://tinyurl.com/684b5h
http://www.twitter.com/reboog711 | Phone: 203-379-0773
--
Easy to use Interface Components for Flex Developers
http://www.flextras.com?c=104
--
http://www.theflexshow.com
http://www.jeffryhouser.com
--
Part of the DotComIt Brain Trust