|
-
[RESOLVED] Dispatch and Listen for a Global Event
All,
Thanks for your patience, I know there's been quite a few posts about events, but I've run into a problem that I haven't really encountered before, and I've kind of confused myself with all the talk of "bubbles" and "capture" and various complexities of creating custom events, etc...
Anyway, I'm trying to figure out how to dispatch a global broadcast style of event.
1) If I have a custom class that resides in the Display List (the DispatcherClass), how do I set up this class to broadcast a "global" event?
Actionscript Code:
dispatchEvent(new Event()); // help me fill this out
1b) If I have another custom class that also resides in the Display List (but in a completely unrelated heirarchy), how do I get this ListenerClass to "hear" the event WITHOUT explicitly referencing the instance of the DispatcherClass like so:
Actionscript Code:
DispatcherClassInstance.addEventListener("DispatcherClassEvent", handler, false, 0, true);
Is this even possible?
=======
2) What if the DispatcherClass DOES NOT reside in the DisplayList?
Is it possible to dispatch a "global" style event since there is nothing to "bubble" up through?
2b) How would I get a ListenerClass, maybe on the DisplayList, maybe not, to "hear" this event?
So confused...
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|