Class EventDispatcher
The EventDispatcher class is the base class for all classes that dispatch events. It is the base class for the DisplayObject class.
Constructor Attributes | Constructor Name and Description |
---|---|
Constructor.
|
Method Attributes | Method Name and Description |
---|---|
addEventListener(type, listener)
Registers an event listener with an EventDispatcher object so that the listener receives notification of an event.
|
|
dispatchEvent(event)
Dispatches an event to its registered listeners.
|
|
hasEventListener(type)
Checks whether the EventDispatcher object has any listeners registered for a specific type of event.
|
|
Removes all listeners from the EventDispatcher object.
|
|
removeEventListener(type, listener)
Removes a listener from the EventDispatcher object.
|
|
Removes a listener with specific event type from the EventDispatcher object.
|
Method Detail
addEventListener(type, listener)
Registers an event listener with an EventDispatcher object so that the listener receives notification of an event.
- Parameters:
- type
- listener
dispatchEvent(event)
Dispatches an event to its registered listeners.
- Parameters:
- event
hasEventListener(type)
Checks whether the EventDispatcher object has any listeners registered for a specific type of event.
- Parameters:
- type
removeAllEventListeners()
Removes all listeners from the EventDispatcher object.
removeEventListener(type, listener)
Removes a listener from the EventDispatcher object.
- Parameters:
- type
- listener
removeEventListenerByType(type)
Removes a listener with specific event type from the EventDispatcher object.
- Parameters:
- type