| Package | system.events |
| Class | public class CoreEventDispatcher |
| Inheritance | CoreEventDispatcher Object |
| Implements | IEventDispatcher, Lockable |
| Subclasses | ConfigurableObject, CoreBuilder, CoreModel, Localization, NetServerConnection, NetStreamClient, ObjectResourceInfo, TimelineInspector |
IEventDispatcher implementations. This class used composition with an internal EventDispatcher object.
You can overrides the internal EventDispatcher instance with the initEventDispatcher or the setEventDispatcher methods. Used a global singleton reference in this method to register all events in a FrontController for example.
| Property | Defined By | ||
|---|---|---|---|
| channel : String [read-only]
Indicates the channel of this dispatcher if this instance is global. | CoreEventDispatcher | ||
| Method | Defined By | ||
|---|---|---|---|
CoreEventDispatcher(global:Boolean = false, channel:String = null)
Creates a new CoreEventDispatcher instance. | CoreEventDispatcher | ||
addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0.0, useWeakReference:Boolean = false):void
Allows the registration of event listeners on the event target. | CoreEventDispatcher | ||
dispatchEvent(event:Event):Boolean
Dispatches an event into the event flow. | CoreEventDispatcher | ||
Returns the internal system.events.EventDispatcher reference. | CoreEventDispatcher | ||
hasEventListener(type:String):Boolean
Checks whether the EventDispatcher object has any listeners registered for a specific type of event. | CoreEventDispatcher | ||
isGlobal():Boolean
Indicates if the dispatcher use a global event flow. | CoreEventDispatcher | ||
isLocked():Boolean
Returns true if the object is locked. | CoreEventDispatcher | ||
lock():void
Locks the object. | CoreEventDispatcher | ||
registerEventListener(type:String, listener:*, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
Allows the registration of event listeners on the event target (Function or EventListener). | CoreEventDispatcher | ||
removeEventListener(type:String, listener:Function, useCapture:Boolean = false):void
Removes a listener from the EventDispatcher object. | CoreEventDispatcher | ||
setEventDispatcher(dispatcher:EventDispatcher):void
Sets the internal EventDispatcher reference. | CoreEventDispatcher | ||
setGlobal(flag:Boolean = false, channel:String = null):void
Sets if the instance use a global system.events.EventDispatcher to dispatch this events, if the flag value is false the instance use a local EventDispatcher. | CoreEventDispatcher | ||
unlock():void
Unlocks the display. | CoreEventDispatcher | ||
unregisterEventListener(type:String, listener:*, useCapture:Boolean = false):void
Removes a listener (Function or EventListener object) from the EventDispatcher object. | CoreEventDispatcher | ||
willTrigger(type:String):Boolean
Checks whether an event listener is registered with this EventDispatcher object or any of its ancestors for the specified event type. | CoreEventDispatcher | ||
| Method | Defined By | ||
|---|---|---|---|
Creates and returns the internal EventDispatcher reference (this method is invoked in the constructor). | CoreEventDispatcher | ||
| channel | property |
channel:String [read-only] Indicates the channel of this dispatcher if this instance is global.
public function get channel():String| CoreEventDispatcher | () | Constructor |
public function CoreEventDispatcher(global:Boolean = false, channel:String = null)Creates a new CoreEventDispatcher instance.
Parametersglobal:Boolean (default = false) — the flag to use a global event flow or a local event flow.
| |
channel:String (default = null) — the name of the global event flow if the global argument is true.
|
| addEventListener | () | method |
public function addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0.0, useWeakReference:Boolean = false):voidAllows the registration of event listeners on the event target.
Parameters
type:String — A string representing the event type to listen for. If eventName value is "ALL" addEventListener use addGlobalListener
| |
listener:Function — The object that receives a notification when an event of the specified type occurs. This must be an object implementing the EventListener interface.
| |
useCapture:Boolean (default = false) — Determinates if the event flow use capture or not.
| |
priority:int (default = 0.0) — Determines the priority level of the event listener.
| |
useWeakReference:Boolean (default = false) — Indicates if the listener is a weak reference.
|
| dispatchEvent | () | method |
public function dispatchEvent(event:Event):BooleanDispatches an event into the event flow.
Parameters
event:Event — The Event object that is dispatched into the event flow.
|
Boolean — true if the Event is dispatched.
|
| getEventDispatcher | () | method |
public function getEventDispatcher():EventDispatcher
Returns the internal system.events.EventDispatcher reference.
EventDispatcher — the internal system.events.EventDispatcher reference.
|
| hasEventListener | () | method |
public function hasEventListener(type:String):BooleanChecks whether the EventDispatcher object has any listeners registered for a specific type of event. This allows you to determine where altered handling of an event type has been introduced in the event flow heirarchy by an EventDispatcher object.
Parameters
type:String |
Boolean |
| initEventDispatcher | () | method |
protected function initEventDispatcher():EventDispatcher
Creates and returns the internal EventDispatcher reference (this method is invoked in the constructor).
You can overrides this method if you wan use a global EventDispatcher singleton.
EventDispatcher — the internal EventDispatcher reference.
|
| isGlobal | () | method |
public function isGlobal():BooleanIndicates if the dispatcher use a global event flow.
ReturnsBoolean — true if the dispatcher use a global event flow.
|
| isLocked | () | method |
public function isLocked():Boolean
Returns true if the object is locked.
Boolean — true if the object is locked.
|
| lock | () | method |
public function lock():voidLocks the object.
| registerEventListener | () | method |
public function registerEventListener(type:String, listener:*, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):voidAllows the registration of event listeners on the event target (Function or EventListener).
Parameters
type:String — A string representing the event type to listen for. If eventName value is "ALL" addEventListener use addGlobalListener
| |
listener:* — The object that receives a notification when an event of the specified type occurs. This must be an object implementing the EventListener interface.
| |
useCapture:Boolean (default = false) — Determinates if the event flow use capture or not.
| |
priority:int (default = 0) — Determines the priority level of the event listener.
| |
useWeakReference:Boolean (default = false) — Indicates if the listener is a weak reference.
|
| removeEventListener | () | method |
public function removeEventListener(type:String, listener:Function, useCapture:Boolean = false):void
Removes a listener from the EventDispatcher object.
If there is no matching listener registered with the EventDispatcher object, then calling this method has no effect.
Parameters
type:String — The type of event.
| |
listener:Function — The listener object to remove.
| |
useCapture:Boolean (default = false) — Specifies whether the listener was registered for the capture phase or the target and bubbling phases. If the listener was registered for both the capture phase and the target and bubbling phases, two calls to removeEventListener() are required to remove both, one call with useCapture() set to true , and another call with useCapture() set to false .
|
| setEventDispatcher | () | method |
public function setEventDispatcher(dispatcher:EventDispatcher):void
Sets the internal EventDispatcher reference.
Parameters
dispatcher:EventDispatcher — The EventDispatcher reference used in this instance.
|
| setGlobal | () | method |
public function setGlobal(flag:Boolean = false, channel:String = null):void
Sets if the instance use a global system.events.EventDispatcher to dispatch this events, if the flag value is false the instance use a local EventDispatcher.
Parameters
flag:Boolean (default = false) — the flag to use a global event flow or a local event flow.
| |
channel:String (default = null) — the name of the global event flow if the flag argument is true.
|
| unlock | () | method |
public function unlock():voidUnlocks the display.
| unregisterEventListener | () | method |
public function unregisterEventListener(type:String, listener:*, useCapture:Boolean = false):void
Removes a listener (Function or EventListener object) from the EventDispatcher object.
If there is no matching listener registered with the EventDispatcher object, then calling this method has no effect.
Parameters
type:String — The type of event.
| |
listener:* — The listener object to remove.
| |
useCapture:Boolean (default = false) — Specifies whether the listener was registered for the capture phase or the target and bubbling phases. If the listener was registered for both the capture phase and the target and bubbling phases, two calls to removeEventListener() are required to remove both, one call with useCapture() set to true , and another call with useCapture() set to false .
|
| willTrigger | () | method |
public function willTrigger(type:String):Boolean
Checks whether an event listener is registered with this EventDispatcher object or any of its ancestors for the specified event type.
This method returns true if an event listener is triggered during any phase of the event flow when an event of the specified type is dispatched to this EventDispatcher object or any of its descendants.
Parameters
type:String |
Boolean — A value of true if a listener of the specified type will be triggered; false otherwise.
|