Dispatches events to all added listeners with the help of an BasicEvent and using listener priority to call handler in correct order.
The higher the number, the higher the priority.
All listeners with priority n are processed before listeners of priority n-1.
The default priority is 0.
Can use single access point using getInstance and get always the same #@link PriorityEventBroadcaster} instance.
static public function getInstance():PriorityEventBroadcaster
Returns PriorityEventBroadcaster instance.
Always return the same instance.
public function getListenerArray(t:String):PriorityListenerArray
Returns an ListenerArray of listeners that suscribed for passed-in t event
or for all events if parameter is omitted.
t | Event type. If event type is undefined, method will return listeners that suscribed for all events. |
a PriorityListenerArray instance
public function addListener(listener, f:Function, priority:Number):Void
Adds passed-in listener for receiving all events.
listener | Listener object |
f | (optional) new callback function |
priority | ( optionnal ) listener priority |
public function addPriorityListener(listener, priority:Number):Void
Adds passed-in listener for receiving all events.
listener | Listener object |
priority | ( optionnal ) listener priority |
public function addEventListener(type:String, listener):Void
Adds passed-in listener for receiving passed-in event type event.
As we can pass many arguments in method call, priority value is retreive using
the argument.length - 1 argument index.
// priority == 10 ob.addEventListener( "MyEvent", this, _handleCallback, "param1", "param2", 10 );