The two are pretty much the same, except for one big thing:
EventDispatcher allows you to distinguish between types of events.
AsBroadcaster just says, "Hey, there's been an update," while
EventDispatcher gives detailed information (in an Event object) about
exactly what that event was and only notifies the listeners which are
listening to that type of event.
Another advantage to using EventDispatcher is that EventDispatcher is
heavily integrated into ActionScript 3.0, to the point that at least
half the classes you'll encounter are dispatchers. Every single
display object (movie clips, buttons, components, etc.) is a
dispatcher, some with dozens of types of events ("mouseMove", "load",
"enterFrame", etc.). AsBroadcaster, on the other hand, is deprecated.
On 1/18/07, Reuben Stanton <[EMAIL PROTECTED]> wrote:
I have used both extensively and find that AsBroadcaster allows me to
do the same thing in fewer lines of code, yet there seems to be a
general preference in the flash community to use EventDispatcher.
Is there any particular reason to use one or the other?
_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com
--
T. Michael Keesey
Director of Technology
Exopolis, Inc.
2894 Rowena Avenue Ste. B
Los Angeles, California 90039
--
The Dinosauricon: http://dino.lm.com
Parry & Carney: http://parryandcarney.com
ISPN Forum: http://www.phylonames.org/forum/
_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com