| Package | org.osflash.signals |
| Interface | public interface IPrioritySignal extends ISignal, IOnceSignal |
| Implementors | PrioritySignal |
| Method | Defined By | ||
|---|---|---|---|
![]() |
Subscribes a listener for the signal. | ISignal | |
![]() |
Subscribes a one-time listener for this signal. | IOnceSignal | |
addOnceWithPriority(listener:Function, priority:int = 0):ISlot
Subscribes a one-time listener for this signal. | IPrioritySignal | ||
addWithPriority(listener:Function, priority:int = 0):ISlot
Subscribes a listener for the signal. | IPrioritySignal | ||
![]() | dispatch(... valueObjects):void
Dispatches an object to listeners. | IOnceSignal | |
![]() |
Unsubscribes a listener from the signal. | IOnceSignal | |
![]() | removeAll():void
Unsubscribes all listeners from the signal. | IOnceSignal | |
| addOnceWithPriority | () | method |
public function addOnceWithPriority(listener:Function, priority:int = 0):ISlotSubscribes a one-time listener for this signal. The signal will remove the listener automatically the first time it is called, after the dispatch to all listeners is complete.
Parameters
listener:Function — A function with an argument
that matches the type of event dispatched by the signal.
If eventClass is not specified, the listener and dispatch() can be called without an argument.
| |
priority:int (default = 0) — The priority level of the event listener.
The priority is designated by a signed 32-bit integer.
The higher the number, the higher the priority.
All listeners with priority n are processed before listeners of priority n-1.
|
ISlot — a ISlot, which contains the Function passed as the parameter
|
See also
| addWithPriority | () | method |
public function addWithPriority(listener:Function, priority:int = 0):ISlotSubscribes a listener for the signal. After you successfully register an event listener, you cannot change its priority through additional calls to add(). To change a listener's priority, you must first call remove(). Then you can register the listener again with the new priority level.
Parameters
listener:Function — A function with an argument
that matches the type of event dispatched by the signal.
If eventClass is not specified, the listener and dispatch() can be called without an argument.
| |
priority:int (default = 0) |
ISlot — a ISlot, which contains the Function passed as the parameter
|
See also