1) Yes. But only if they add the listeners to an object which either dispatches or is in the display ancestry. And the latter only if the event bubbles.To summarize:
Can two display objects at the same depth in the DisplayObject hierarchy hear each others events?
Can't a DisplayObject hear the events fired from its' children?
Does event propogation 'phases' mean the event goes up and then back down the hierarchy?
For instance, if your client wanted to listen for the database dispatching an LOGIN_REQUEST event (which I'm making up), the code could go like this:
That or similar code could be done anywhere you have a reference to both the client and the database.Code:database.addEventListener(LoginEvent.LOGIN_REQUEST, client.doSomeLoginLogic);
2) Yes. But only if those events bubble.
3) Backwards. The capture phase is when it goes down from stage to target, the bubble phase then happens, and goes back from target up to stage. Again, only if the event bubbles.




Reply With Quote