Packagesystem.events
Classpublic class EventDispatcher
InheritanceEventDispatcher Inheritance InternalDispatcher Inheritance flash.events.EventDispatcher

Stores the listeners object an notifies them with the DOM Events level 2/3 of the W3C. The EventDispatcher class implements the system.events.IEventDispatcher interface. This object allows any object to be an EventTarget.



Public Properties
 PropertyDefined By
  channel : String
Indicates the channel of the dispatcher.
EventDispatcher
 Inheritedtarget : IEventDispatcher
[read-only] Indicates the optional target reference of the instance.
InternalDispatcher
Public Methods
 MethodDefined By
  
EventDispatcher(target:IEventDispatcher = null, channel:String = null)
Creates a new EventDispatcher instance.
EventDispatcher
  
containsInstance(channel:String):Boolean
[static] Indicates if the specified singleton reference is register.
EventDispatcher
 Inherited
fireEvent(event:*, target:* = null, context:* = null, bubbles:Boolean = false):Boolean
Dispatches an event into the event flow.
InternalDispatcher
  
flush():void
[static] Clear all globals EventDispatcher singletons.
EventDispatcher
  
getChannels():Array
[static] Returns the Array representation of all channels register in the EventDispatcher factory or null if no singletons are registered.
EventDispatcher
  
getInstance(channel:String = null):EventDispatcher
[static] Creates and returns a singleton EventDispatcher reference specified by the passed-in name identifier.
EventDispatcher
 Inherited
registerEventListener(type:String, listener:*, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
Registers an system.events.EventListener object with an system.events.EventDispatcher object so that the listener receives notification of an event.
InternalDispatcher
  
removeInstance(channel:String = null):Boolean
[static] Removes a global EventDispatcher singleton.
EventDispatcher
 Inherited
unregisterEventListener(type:String, listener:*, useCapture:Boolean = false):void
Removes an system.events.EventListener from the system.events.EventDispatcher object.
InternalDispatcher
Public Constants
 ConstantDefined By
  DEFAULT_SINGLETON_CHANNEL : String = __default__
[static] Determinates the default singleton channel.
EventDispatcher
Property Detail
channelproperty
channel:String

Indicates the channel of the dispatcher.


Implementation
    public function get channel():String
    public function set channel(value:String):void
Constructor Detail
EventDispatcher()Constructor
public function EventDispatcher(target:IEventDispatcher = null, channel:String = null)

Creates a new EventDispatcher instance.

Parameters
target:IEventDispatcher (default = null) — The target object for events dispatched to the EventDispatcher object. This parameter is used when the EventDispatcher instance is aggregated by a class that implements IEventDispatcher; it is necessary so that the containing object can be the target for events. Do not use this parameter in simple cases in which a class extends EventDispatcher.
 
channel:String (default = null) — The optional channel value of the dispatcher (use it in a global event flow).
Method Detail
containsInstance()method
public static function containsInstance(channel:String):Boolean

Indicates if the specified singleton reference is register.

Parameters

channel:String — the channel value of the singleton reference register in the factory.

Returns
Booleantrue If the specified singleton reference is register.
flush()method 
public static function flush():void

Clear all globals EventDispatcher singletons.

getChannels()method 
public static function getChannels():Array

Returns the Array representation of all channels register in the EventDispatcher factory or null if no singletons are registered.

Returns
Array — the Array representation of all channels register in the EventDispatcher factory or null if no singletons are registered.
getInstance()method 
public static function getInstance(channel:String = null):EventDispatcher

Creates and returns a singleton EventDispatcher reference specified by the passed-in name identifier.

Parameters

channel:String (default = null) — The name of the singleton reference to return or create (If this value is Null, the DEFAULT_SINGLETON_NAME static value is used).

Returns
EventDispatcher — The singleton EventDispatcher reference specified by the passed-in name identifier.
removeInstance()method 
public static function removeInstance(channel:String = null):Boolean

Removes a global EventDispatcher singleton.

Parameters

channel:String (default = null)

Returns
Booleantrue if a singleton is removed in the EventDispatcher factory.
Constant Detail
DEFAULT_SINGLETON_CHANNELConstant
public static const DEFAULT_SINGLETON_CHANNEL:String = __default__

Determinates the default singleton channel.