--- In [email protected], "Alex Harui" <[EMAIL PROTECTED]> wrote:
>
> Are you listening to the container that is being hidden? You can listen
> at the systemManager, get all hides and see which ones affect your
> parents if you want.
>
> ________________________________
>
> From: [email protected] [mailto:[EMAIL PROTECTED] On
> Behalf Of Matt
> Sent: Tuesday, May 08, 2007 2:10 PM
> To: [email protected]
> Subject: [flexcoders] Re: Parent not talking to Children
>
>
>
> --- In [email protected] <mailto:flexcoders%40yahoogroups.com>
> , "Alex Harui" <aharui@> wrote:
> >
> > Only the thing being hidden dispatches an event. The children do not
> > dispatch their own event, nor do their visible properties get set to
> > false even though they are now visible.
> >
> > You can use "capture" phase listeners to see changes in all children
> of
> > a display object.
> >
> > ________________________________
> >
> > From: [email protected] <mailto:flexcoders%40yahoogroups.com>
> [mailto:[email protected] <mailto:flexcoders%40yahoogroups.com>
> ] On
> > Behalf Of Matt
> > Sent: Tuesday, May 08, 2007 1:39 PM
> > To: [email protected] <mailto:flexcoders%40yahoogroups.com>
> > Subject: [flexcoders] Re: Parent not talking to Children
> >
> >
> >
> > --- In [email protected]
> <mailto:flexcoders%40yahoogroups.com>
> <mailto:flexcoders%40yahoogroups.com>
> > , "Matt" <matt@> wrote:
> > >
> > > When a container gets hidden shouldn't it throw a hide event to the
> > > children? I have a TitledWindow and a Canvas inside it and when I
> set
> > > visible to false on the TitledWindow I can't seem to capture
> anything
> > > on the Canvas telling me it was hidden, it just disappears.
> > >
> > > Can anyone either explain a work-around or the error in my logic?
> > >
> >
> > Any insights on this would be appreciated. The purpose of this is to
> > monitor any changes to the component to propagate to an IFrame (yes,
> > another web browser implementation).
> >
> I've tried to do this with addEventListener(FlexEvent.HIDE, onHide,
> true) to my child but it never receives an event.
>
I got a solution to the problem. For anyone that cares I added
listeners to systemManager (after initialization) with capture as
true, then I check to make sure target.owns(this) then I set
visibility based on this function:
private function isVisible():Boolean {
var obj:DisplayObjectContainer = this;
while (obj != null) {
if (!obj.visible) {
return false;
}
obj = obj.parent;
}
return true;
}
I was hoping for a little prettier way to go, but this is manageable
and works.
Thanks for all the help guys.