Events bubble up (from child to parent, but not the other way). You must
explicitly dispatch a bubbling event in order for it to bubble (bubbling is
expensive in terms of performance). SWIZ uses couple of different techniques
to bind the dispatchers and listeners, one of those techniques is to add a
handler to the capture phase of an event. This is by some weirdness of Flash
Player event model, that all display objects dispatch events that have the
capture phase, and if you add a handler for that phase globally, this
handler will be called before the handlers added to target or bubbling
phases. I see this as a bad practice, and would not encourage you to do so
for many reasons, but it's to much for this question. I still think that
adding handlers directly to the dispatchers is the best way to go about it.
Whilst if you can do with the simple callbacks, it is even better.
EventDispatcher offers a sort of abstraction level / common interface in
order to make your work more consistent / easier to understand for other
people, at the same time it adds some overhead. So, if the added overhead
isn't important to you, and you want to work by the guidelines, then events
are the way to go, but if performance is more important, then stick to plain
callbacks.

Reply via email to