Packagevegas.events
Classpublic class CoreEventDispatcher
InheritanceCoreEventDispatcher Inheritance CoreObject
ImplementsIEventDispatcher, ILockable
SubclassesAbstractBuilder, AbstractModel, AbstractTarget, ArrayFilter, ConfigurableObject, Localization, NetServerConnection, NetServerStreamClient, RemotingServiceListener, SimpleAction, TransitionController

This abstract class is used to create concrete 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.



Public Properties
 PropertyDefined 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
Public Methods
 MethodDefined 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
 Inherited
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
 Inherited
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
  
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
 Inherited
setLogger(log:ILogger = null):void
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
 Inherited
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
Property detail
channelproperty
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
isGlobalproperty 
isGlobal:Boolean  [read-only]

(read-only) Returns the value of the isGlobal flag of this model. Use the setGlobal method to modify this value.

Implementation
    public function get isGlobal():Boolean
Constructor detail
CoreEventDispatcher()constructor
public function CoreEventDispatcher(bGlobal:Boolean = false, sChannel:String = null)

Creates a new CoreEventDispatcher.

Parameters
bGlobal: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.
Method detail
addEventListener()method
public function 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.

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):Boolean

Dispatches an event into the event flow.

Parameters
event:Event — The Event object that is dispatched into the event flow.

Returns
Booleantrue if the Event is dispatched.
getEventDispatcher()method 
public function getEventDispatcher():EventDispatcher

Returns the internal EventDispatcher reference.

Returns
EventDispatcher — the internal EventDispatcher reference.
getIsGlobal()method 
public function getIsGlobal():Boolean

Returns the value of the isGlobal flag of this model.

Returns
Booleantrue if the instance use a global EventDispatcher to dispatch this events.
hasEventListener()method 
public function hasEventListener(type:String):Boolean

Checks 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

Returns
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.

Returns
EventDispatcher — the internal EventDispatcher reference.
isLocked()method 
public function isLocked():Boolean

Returns true if the object is locked.

Returns
Booleantrue if the object is locked.
lock()method 
public function lock():void

Locks the object.

registerEventListener()method 
public function 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).

Parameters
type: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.

Parameters
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.

Parameters
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.

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.
toSource()method 
public override function toSource(indent:int = 0):String

Returns the string representation the source code of the object.

Parameters
indent:int (default = 0)

Returns
String — the string representation the source code of the object.
unlock()method 
public function unlock():void

Unlocks 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.

Parameters
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.

Parameters
type:String

Returns
Boolean — A value of true if a listener of the specified type will be triggered; false otherwise.