[flexcoders] Re: Broadcasting event to all objects on display list

2008-02-14 Thread thirtyfivemph
Actually, I'm trying to avoid each DisplayObject tracing its way back to the root (which, at any given time, it may not be able to do depending on where it is in the DisplayList, on or off the stage, etc.). Here's a more succinct way to ask my question: Given that the display list is a classic tr

RE: [flexcoders] Re: Broadcasting event to all objects on display list

2008-02-14 Thread Alex Harui
abstraction you want. From: flexcoders@yahoogroups.com [mailto:[EMAIL PROTECTED] On Behalf Of thirtyfivemph Sent: Thursday, February 14, 2008 8:17 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: Broadcasting event to all objects on display list Actually, I&#x

Re: [flexcoders] Re: Broadcasting event to all objects on display list

2008-02-14 Thread Troy Gilbert
> If each node must be responsible for the dispatch to its children, then yes, > you're probably doing it the right way. It'll chew up some cycles, but all > tree walks effectively do. The only way to "optimize" is to flatten the > tree at some point which breaks the abstraction you want. Cool.

RE: [flexcoders] Re: Broadcasting event to all objects on display list

2008-02-14 Thread Gordon Smith
Behalf Of thirtyfivemph Sent: Thursday, February 14, 2008 8:17 AM To: flexcoders@yahoogroups.com Subject: [flexcoders] Re: Broadcasting event to all objects on display list Actually, I'm trying to avoid each DisplayObject tracing its way back to the root (which, at any given time, it may not be

Re: [flexcoders] Re: Broadcasting event to all objects on display list

2008-02-14 Thread Troy Gilbert
> It would be unnatural to try to use the event mechanism to propogate an > event to all descendants of a tree node. Use a recursive method call to > accomplish this. So, you're thinking something like this (pseudo-code): for (var i:int = 0; i < this.numChildren; i++) { var child:IPropogatabl

RE: [flexcoders] Re: Broadcasting event to all objects on display list

2008-02-14 Thread Gordon Smith
oders@yahoogroups.com Subject: Re: [flexcoders] Re: Broadcasting event to all objects on display list > It would be unnatural to try to use the event mechanism to propogate an > event to all descendants of a tree node. Use a recursive method call to > accomplish this. So, you're thinking