| Package | vegas.events |
| Class | public class CoreEventDispatcher |
| Inheritance | CoreEventDispatcher CoreObject |
| Implements | IEventDispatcher, ILockable |
| Subclasses | AbstractBuilder, AbstractModel, AbstractTarget, ArrayFilter, ConfigurableObject, Localization, NetServerConnection, NetServerStreamClient, RemotingServiceListener, SimpleAction, TransitionController |
IEventDispatcher implementations. This class used an internal EventDispatcher object by composition.
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 | ||
| isGlobal : Boolean [read-only]
(read-only) Returns the value of the isGlobal flag of this model.
| CoreEventDispatcher | ||
| Method | Defined by | ||
|---|---|---|---|
|
CoreEventDispatcher(bGlobal:Boolean = false, sChannel:String = null)
Creates a new CoreEventDispatcher.
| 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
EventDispatcher reference. | CoreEventDispatcher | ||
|
getIsGlobal():Boolean
Returns the value of the isGlobal flag of this model.
| CoreEventDispatcher | ||
![]() |
Returns the internal
ILogger reference of this ILogable object. | CoreObject | |
|
hasEventListener(type:String):Boolean
Checks whether the EventDispatcher object has any listeners registered for a specific type of event.
| CoreEventDispatcher | ||
![]() |
hashCode():uint
Returns a hashcode value for the object.
| CoreObject | |
|
Creates and returns the internal
EventDispatcher reference (this method is invoked in the constructor). | CoreEventDispatcher | ||
|
isLocked():Boolean
Returns
true if the object is locked. | CoreEventDispatcher | ||
|
lock():void
Locks the object.
| CoreEventDispatcher | ||
|
registerEventListener(type:String, listener:Boolean, useCapture:int = false, priority:Boolean = 0, useWeakReference:* = 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(e:EventDispatcher):void
Sets the internal
EventDispatcher reference. | CoreEventDispatcher | ||
|
setGlobal(flag:Boolean = false, channel:String = null):void
Sets if the instance use a global
EventDispatcher to dispatch this events, if the flag value is false the instance use a local EventDispatcher. | CoreEventDispatcher | ||
![]() |
Sets the internal
ILogger reference of this ILogable object. | CoreObject | |
|
toSource(indent:int = 0):String
Returns the string representation the source code of the object.
| CoreEventDispatcher | ||
![]() |
toString():String
Returns the string representation of this instance.
| CoreObject | |
|
unlock():void
Unlocks the display.
| CoreEventDispatcher | ||
|
unregisterEventListener(type:String, listener:Boolean, useCapture:* = 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 | ||
| channel | property |
channel:String [read-only]Indicates the channel of this dispatcher if this instance is global. #see isGlobal #see setGlobal
Implementation public function get channel():String
| isGlobal | property |
isGlobal:Boolean [read-only]
(read-only) Returns the value of the isGlobal flag of this model. Use the setGlobal method to modify this value.
public function get isGlobal():Boolean
| CoreEventDispatcher | () | constructor |
public function CoreEventDispatcher(bGlobal:Boolean = false, sChannel:String = null)Creates a new CoreEventDispatcher.
ParametersbGlobal:Boolean (default = false) — the flag to use a global event flow or a local event flow.
|
|
sChannel:String (default = null) — the name of the global event flow if the bGlobal 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.
Parameterstype: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.
Parametersevent: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 EventDispatcher reference.
EventDispatcher —
the internal EventDispatcher reference.
|
| getIsGlobal | () | method |
public function getIsGlobal():BooleanReturns the value of the isGlobal flag of this model.
ReturnsBoolean — true if the instance use a global EventDispatcher to dispatch this events.
|
| 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.
Parameterstype:String |
Boolean |
| initEventDispatcher | () | method |
public 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.
|
| 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:Boolean, useCapture:int = false, priority:Boolean = 0, useWeakReference:* = false):voidAllows the registration of event listeners on the event target (Function or EventListener).
Parameterstype:String — A string representing the event type to listen for. If eventName value is "ALL" addEventListener use addGlobalListener
|
|
listener:Boolean — The object that receives a notification when an event of the specified type occurs. This must be an object implementing the EventListener interface.
|
|
useCapture:int (default = false) — Determinates if the event flow use capture or not.
|
|
priority:Boolean (default = 0) — Determines the priority level of the event listener.
|
|
useWeakReference:* (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.
type:String — Specifies the type of event.
|
|
listener:Function — listener object.
|
|
useCapture:Boolean (default = false) |
| setEventDispatcher | () | method |
public function setEventDispatcher(e:EventDispatcher):void
Sets the internal EventDispatcher reference.
e:EventDispatcher |
| setGlobal | () | method |
public function setGlobal(flag:Boolean = false, channel:String = null):void
Sets if the instance use a global EventDispatcher to dispatch this events, if the flag value is false the instance use a local EventDispatcher.
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.
|
| toSource | () | method |
public override function toSource(indent:int = 0):StringReturns the string representation the source code of the object.
Parametersindent:int (default = 0) |
String — the string representation the source code of the object.
|
| unlock | () | method |
public function unlock():voidUnlocks the display.
| unregisterEventListener | () | method |
public function unregisterEventListener(type:String, listener:Boolean, useCapture:* = 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.
type:String — Specifies the type of event.
|
|
listener:Boolean — listener object.
|
|
useCapture:* (default = 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.
type:String |
Boolean — A value of true if a listener of the specified type will be triggered; false otherwise.
|