
TUTORIALS POINT
Simply Easy Learning Page 49
Event Dispatcher Class
Introduction
The EventDispatcher class is the base class for all classes that dispatch events.
The EventDispatcher class implements the IEventDispatcher interface.
The EventDispatcher class allows any object on the display list to be an event target and as such, to use
the methods of the IEventDispatcher interface.
In order to understand EventDispatcher, let us first look what are event and event targets.
What is an Event?
Event is a notification when a particular action is performed.For example, when a button is clicked then Click Event
occurs.
What is an Event Target
The Event target serves as the focal point for how events flow through the display list hierarchy.
When an event occurs, Flash Player dispatches an event object into the event flow from the root of the display list.
The event object then makes its way through the display list until it reaches the event target, at which point it begins
its return trip through the display list.
This round-trip journey to the event target is divided into three phases:
capture
This phase comprises the journey from the root to the last node before the event target's node
target
This phase comprises only the event target node.
bubbling
This phase comprises any subsequent nodes encountered on the return trip to the root of the display list.
In general, any class which extends EventDispatcher gets the event dispatching capability.
Class declaration
Following is the declaration for flash.events.EventDispatcher class:
public class EventDispatcher
extends java.lang.Object
implements IEventDispatcher
Public methods
Commentaires sur ces manuels