Ok - then here is an approach that will get you started. Components like the
view stack use deferred instantiation to help with performance. which means
that any control that isn't initially visible hasn't been fully instantiated
yet. This means that the 'added to stage' event hasn't fired. and won't
until you click on the tab/viewstack that contains it. All this assumes that
you haven't touched the creationPolicy - which instantiates all controls on
every layer.

 

If you add the added to stage listener to the control in the pre-init or
constructor. when fired you know that the component truly exists. At this
point you can crawl  parents to see if at some point you are a child of one
of your troublesome containers. While doing this you should also check
visibility as well (if any are not visible - neither is your component) and
track selectedIndex compared to the layer index you are on.  

 

Do I exist? - based on stage prescence.

What is my visibility? - based on parent visibility.

Am I in a troublesome control? - based on class type.

What is the selectedIndex? - based on the component property.

Amy I on the selectedIndex layer? - drill down the hierarchy to look for
your control. 

 

 

Rick Winscot

 

 

From: [email protected] [mailto:[EMAIL PROTECTED] On
Behalf Of joshuagatcke
Sent: Monday, April 14, 2008 9:48 PM
To: [email protected]
Subject: [flexcoders] Re: Intelligent ViewStack Children

 

Hi Rick, 

Thanks for the response. 

You are right on the money. Our component can exist anywhere, including
inside a 
ViewStack. We are working with an iframe component (over the flash) and
really having a 
problem with ViewStacks. We just want to find a property of anything that
could enable the 
component to know if it is or isn't inside a ViewStack and if so, if the
component is suppose 
to be showing or not. 

 

<<image001.jpg>>

<<image002.jpg>>

Reply via email to