O'Reilly logo

Essential ActionScript 3.0 by Colin Moock

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Event Dispatch Phases

As we just learned, when ActionScript dispatches an event targeted at an object in a display hierarchy, it notifies not just that target but also its display ancestors. The process by which the target and its ancestors are notified of the event is broken into three distinct phases. In the first phase of the event dispatch, known as the capture phase, each of the target's ancestors is notified that the event has occurred. Once the target object's ancestors have all been notified of the event, then the second phase of the event dispatch, known as the target phase, begins. During the target phase, ActionScript notifies the target object that the event occurred.

For some event types, the event dispatch ends once the target phase is complete. For other event types, the event dispatch continues into a third phase, known as the bubbling phase. During the bubbling phase, the ancestors of the target object are notified that the target successfully received the event notification. Events with a bubbling phase are known as bubbling events; events without a bubbling phase are known as nonbubbling events.

Tip

The four event types Event.ACTIVATE, Event.DEACTIVATE, Event.ENTER_FRAME, and Event.RENDER, have a target phase only. All other event dispatches targeted at an object in a display hierarchy have a capture phase and a target phase. Some event types also have a bubbling phase.

The order in which objects are notified of an event during an event dispatch is governed by the ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required