Packageorg.springextensions.actionscript.core.event
SVN browsingIEventBus.as
FisheyeIEventBus.as
Interfacepublic interface IEventBus
ImplementorsEventBusFacade

Describes an object that is used as a publish/subscribe event mechanism that lets objects communicate with eachother in a loosely coupled manner.

There are three ways to add listeners to an IEventBus:

  1. Add a listener for all events that are dispatched by an IEventBus.
  2. Add a listener for all events of a certain type that are dispatched by an IEventBus.
  3. Add a listener for all events of a Class that are dispatched by an IEventBus.



Documentation reference: the eventbus introduction


Public Methods
 MethodDefined by
  
addEventClassListener(eventClass:Class, listener:Function, useWeakReference:Boolean = false):void
Adds a listener function for events of a specific Class.
IEventBus
  
addEventClassListenerProxy(eventClass:Class, proxy:MethodInvoker, useWeakReference:Boolean = false):void
Adds a proxied event handler as a listener for events of a specific Class.
IEventBus
  
addEventListener(type:String, listener:Function, useWeakReference:Boolean = false):void
Adds the given listener function as an event handler to the given event type.
IEventBus
  
addEventListenerProxy(type:String, proxy:MethodInvoker, useWeakReference:Boolean = false):void
Adds a proxied event handler as a listener to the specified event type.
IEventBus
  
addListener(listener:IEventBusListener, useWeakReference:Boolean = false):void
Adds the given listener object as a listener to all events send via the event bus.
IEventBus
  
dispatch(type:String):void
Convenience method for dispatching an event.
IEventBus
  
dispatchEvent(event:Event):void
Dispatches the specified Event on the event bus.
IEventBus
  
removeAll():void
Clears the entire IEventBus by removing all types of listeners.
IEventBus
  
removeEventClassListener(eventClass:Class, listener:Function):void
Removes a listener function for events of a specific Class.
IEventBus
  
removeEventClassListenerProxy(eventClass:Class, proxy:MethodInvoker):void
Removes a proxied event handler as a listener for events of a specific Class.
IEventBus
  
removeEventListener(type:String, listener:Function):void
Removes the given listener function as an event handler from the given event type.
IEventBus
  
removeEventListenerProxy(type:String, proxy:MethodInvoker):void
Removes a proxied event handler as a listener from the specified event type.
IEventBus
  
Removes the given listener from the event bus.
IEventBus
Method detail
addEventClassListener()method
public function addEventClassListener(eventClass:Class, listener:Function, useWeakReference:Boolean = false):void

Adds a listener function for events of a specific Class.

Parameters
eventClass:Class — The specified Class.
 
listener:Function — The specified listener function.
 
useWeakReference:Boolean (default = false)
addEventClassListenerProxy()method 
public function addEventClassListenerProxy(eventClass:Class, proxy:MethodInvoker, useWeakReference:Boolean = false):void

Adds a proxied event handler as a listener for events of a specific Class.

Parameters
eventClass:Class — The specified Class.
 
proxy:MethodInvoker — The specified listener function.
 
useWeakReference:Boolean (default = false)
addEventListener()method 
public function addEventListener(type:String, listener:Function, useWeakReference:Boolean = false):void

Adds the given listener function as an event handler to the given event type.

Parameters
type:String — the type of event to listen to
 
listener:Function — the event handler function
 
useWeakReference:Boolean (default = false)
addEventListenerProxy()method 
public function addEventListenerProxy(type:String, proxy:MethodInvoker, useWeakReference:Boolean = false):void

Adds a proxied event handler as a listener to the specified event type.

Parameters
type:String — the type of event to listen to
 
proxy:MethodInvoker — a proxy method invoker for the event handler
 
useWeakReference:Boolean (default = false)
addListener()method 
public function addListener(listener:IEventBusListener, useWeakReference:Boolean = false):void

Adds the given listener object as a listener to all events send via the event bus.

Parameters
listener:IEventBusListener
 
useWeakReference:Boolean (default = false)
dispatch()method 
public function dispatch(type:String):void

Convenience method for dispatching an event. This will create an Event instance with the given type and call dispatchEvent() on the event bus.

Parameters
type:String — the type of the event to dispatch
dispatchEvent()method 
public function dispatchEvent(event:Event):void

Dispatches the specified Event on the event bus.

Parameters
event:Event — The specified Event.
removeAll()method 
public function removeAll():void

Clears the entire IEventBus by removing all types of listeners.

removeEventClassListener()method 
public function removeEventClassListener(eventClass:Class, listener:Function):void

Removes a listener function for events of a specific Class.

Parameters
eventClass:Class — The specified Class.
 
listener:Function — The specified listener function.
removeEventClassListenerProxy()method 
public function removeEventClassListenerProxy(eventClass:Class, proxy:MethodInvoker):void

Removes a proxied event handler as a listener for events of a specific Class.

Parameters
eventClass:Class — The specified Class.
 
proxy:MethodInvoker — The specified listener function.
removeEventListener()method 
public function removeEventListener(type:String, listener:Function):void

Removes the given listener function as an event handler from the given event type.

Parameters
type:String
 
listener:Function
removeEventListenerProxy()method 
public function removeEventListenerProxy(type:String, proxy:MethodInvoker):void

Removes a proxied event handler as a listener from the specified event type.

Parameters
type:String
 
proxy:MethodInvoker
removeListener()method 
public function removeListener(listener:IEventBusListener):void

Removes the given listener from the event bus.

Parameters
listener:IEventBusListener