Flex Viewstack kids, if you don't see them, do they exist?

It seems that I am facing a problem (I can’t access the properties or the method of referencing a null object) by associating events in actionscript with a presentation level that is not currently displayed. Are these objects not created until this layer is visible for the first time? I remember something about the creation policy, if so, can I get it to create these children before this layer is viewed?

+4
source share
3 answers

Yes, that’s right - ViewStack children are created only by default by default (“deferred instance” is a phrase that you will hear in this context). If instead you want to tell Flex to create all ViewStack children in front, consider using the creationPolicy property common to all mx.core.Containers :

Creating ContainerCreationPolicy.ALL means that the navigator containers immediately create deeper descendants for each child, rather than waiting for the child to be selected.

 <mx:ViewStack id="myStack" creationPolicy="all" /> 

This is a bit slower at startup because you are creating a bunch of child components that you may not need, but as long as you keep this trade-off in mind, it might come in handy someday.

+16
source

Yes, I had the same problem when I was working on an application with a PureMVC framework. I was unable to create picks for the ViewStack subcomponents because they were created lazily using the Flex framework.

Here I ended up finding my solution:

http://forums.puremvc.org/index.php?topic=280.0

+2
source

The relevant documentation was found here . Seems like this would be something you could mention in the container docs.

0
source

All Articles