Packagevegas.events
Classpublic class EventDispatcher
InheritanceEventDispatcher Inheritance AbstractEventDispatcher 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 IEventDispatcher interface. This object allows any object to be an EventTarget.

Thanks:

EventDispatcher is an AS2 port of the Java.schst.net EventDispatcher. Inspired by the NotificationCenter of Apple's Cocoa-Framework.

  • EventDispatcher JAVA : Stephan Schmid - http://schst.net/
  • Cocoa-Framework : http://developer.apple.com/cocoa/
  • Notification center : http://developer.apple.com/documentation/Cocoa/Conceptual/Notifications/index.html


  • Public Properties
     PropertyDefined by
     Inheritedtarget : IEventDispatcher
    Indicates the optional target reference of the instance.
    AbstractEventDispatcher
    Public Methods
     MethodDefined by
      
    Aggregates an instance of the EventDispatcher class.
    EventDispatcher
      
    containsInstance(name:String):Boolean
    [static] Indicates if the specified singleton reference is register.
    EventDispatcher
     Inherited
    fireEvent(event:*, target:Boolean = null, context:* = null, bubbles:* = false):Boolean
    Dispatches an event into the event flow.
    AbstractEventDispatcher
      
    flush():void
    [static] Clear all globals EventDispatcher instances.
    EventDispatcher
      
    getInstance(name:String = null):EventDispatcher
    [static] Creates and returns a singleton EventDispatcher reference specified by the passed-in name identifier.
    EventDispatcher
     Inherited
    Returns the internal ILogger reference of this ILogable object.
    AbstractEventDispatcher
      
    getName():String
    Returns the name of the display.
    EventDispatcher
     Inherited
    hashCode():uint
    Returns a hashcode value for the object.
    AbstractEventDispatcher
     Inherited
    registerEventListener(type:String, listener:Boolean, useCapture:int = false, priority:Boolean = 0, useWeakReference:* = false):void
    Registers an EventListener object with an EventDispatcher object so that the listener receives notification of an event.
    AbstractEventDispatcher
      
    removeInstance(name:String = null):Boolean
    [static] Removes a global EventDispatcher instance.
    EventDispatcher
     Inherited
    setLogger(log:ILogger = null):void
    Sets the internal ILogger reference of this ILogable object.
    AbstractEventDispatcher
      
    setName(name:String):void
    Internal method to sets the name of the instance.
    EventDispatcher
     Inherited
    toSource(indent:int = 0):String
    Returns a string representing the source code of the EventDispatcher object.
    AbstractEventDispatcher
     Inherited
    toString():String
    Returns a string representing the specified EventDispatcher object (ECMA-262).
    AbstractEventDispatcher
     Inherited
    unregisterEventListener(type:String, listener:Boolean, useCapture:* = false):void
    Removes an EventListener from the EventDispatcher object.
    AbstractEventDispatcher
    Public Constants
     ConstantDefined by
      DEFAULT_SINGLETON_NAME : String = "__default__"
    [static] Determinates the default singleton name.
    EventDispatcher
    Constructor detail
    EventDispatcher()constructor
    public function EventDispatcher(target:IEventDispatcher = null)

    Aggregates an instance of the EventDispatcher class.

    Parameters
    target:IEventDispatcher (default = null)
    Method detail
    addEventListener()method
    VEGAS function addEventListener(type:String, listener:Boolean, useCapture:int = false, priority:Boolean = 0, useWeakReference:* = false):void

    Registers an EventListener object with an EventDispatcher object so that the listener receives notification of an event.

    Parameters
    type:String
     
    listener:Boolean
     
    useCapture:int (default = false)
     
    priority:Boolean (default = 0)
     
    useWeakReference:* (default = false)
    containsInstance()method 
    public static function containsInstance(name:String):Boolean

    Indicates if the specified singleton reference is register.

    Parameters
    name:String

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

    Clear all globals EventDispatcher instances.

    getInstance()method 
    public static function getInstance(name:String = null):EventDispatcher

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

    Parameters
    name: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.
    getName()method 
    public function getName():String

    Returns the name of the display.

    Returns
    String — the name of the display.
    removeEventListener()method 
    VEGAS function removeEventListener(type:String, listener:Boolean, useCapture:* = false):void

    Registers an EventListener object with an EventDispatcher object so that the listener receives notification of an event.

    Parameters
    type:String
     
    listener:Boolean
     
    useCapture:* (default = false)
    removeInstance()method 
    public static function removeInstance(name:String = null):Boolean

    Removes a global EventDispatcher instance.

    Parameters
    name:String (default = null)

    Returns
    Boolean
    setName()method 
    public function setName(name:String):void

    Internal method to sets the name of the instance.

    Parameters
    name:String
    Constant detail
    DEFAULT_SINGLETON_NAMEconstant
    public static const DEFAULT_SINGLETON_NAME:String = "__default__"

    Determinates the default singleton name.