Packagenet.guttershark.events
Classpublic class EventBroadcaster

The EventBroadcaster is a static class, and wraps one instance of an event dispatcher and has static methods to work with that single instance of the event dispatcher.


Example
Using the EventBroadcaster
 
  private function onTest(e:Event):void
  {
    trace("event received");
  }
  EventBroadcaster.addEventListener("test",onTest); 
  EventBroadcaster.broadcastEvent(new Event("test"));
  



Public Methods
 MethodDefined by
  
addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void
[static] Add a listener the the event broadcaster.
EventBroadcaster
  
broadcastEvent(event:Event):void
[static] Broadcast an event.
EventBroadcaster
  
hasEventListener(type:String):Boolean
[static] Check to see if there is a listener of specified type on the broadcaster.
EventBroadcaster
  
removeEventListener(type:String, listener:Function, useCapture:Boolean = false):void
[static] Remove an event listener from the broadcaster.
EventBroadcaster
  
willTrigger(type:String):Boolean
[static] Test to see if an event will fire of type.
EventBroadcaster
Method detail
addEventListener()method
public static function addEventListener(type:String, listener:Function, useCapture:Boolean = false, priority:int = 0, useWeakReference:Boolean = false):void

Add a listener the the event broadcaster.

Parameters
type:String — The type of event listener
 
listener:Function — The callback function when event is fired
 
useCapture:Boolean (default = false) — UseCapture or not.
 
priority:int (default = 0) — Priority of the event.
 
useWeakReference:Boolean (default = false) — Use weak references.
broadcastEvent()method 
public static function broadcastEvent(event:Event):void

Broadcast an event.

Parameters
event:Event — Event Any Event.
hasEventListener()method 
public static function hasEventListener(type:String):Boolean

Check to see if there is a listener of specified type on the broadcaster.

Parameters
type:String — The event type.

Returns
Boolean
removeEventListener()method 
public static function removeEventListener(type:String, listener:Function, useCapture:Boolean = false):void

Remove an event listener from the broadcaster.

Parameters
type:String — String The listener type.
 
listener:Function — Function The callback listening function.
 
useCapture:Boolean (default = false) — Boolean UseCapture of not.
willTrigger()method 
public static function willTrigger(type:String):Boolean

Test to see if an event will fire of type.

Parameters
type:String — The event type.

Returns
Boolean