GODPAPER | All Packages | All Classes | Index | Frames No Frames |
PrioritySignal

Package | org.osflash.signals
Class | public class PrioritySignal
Inheritance | PrioritySignal Signal OnceSignal Object
Implements | IPrioritySignal
Subclasses | DeluxeSignal

Default MXML Property `valueClasses`

Public Properties
Hide Inherited Public Properties
Show Inherited Public Properties

| Property | Defined By
--- | --- | ---
|  | numListeners : uint [read-only] The current number of listeners for the signal. | OnceSignal
|  | valueClasses : Array An optional array of classes defining the types of parameters sent to listeners. | OnceSignal

Protected Properties
Hide Inherited Protected Properties
Show Inherited Protected Properties

| Property | Defined By
--- | --- | ---
|  | slots : SlotList | OnceSignal
|  | _valueClasses : Array | OnceSignal

Public Methods
Hide Inherited Public Methods
Show Inherited Public Methods

| Method | Defined By
--- | --- | ---
|  | PrioritySignal(... valueClasses) | PrioritySignal
|  | add(listener:Function):ISlot Subscribes a listener for the signal. | Signal
|  | addOnce(listener:Function):ISlot Subscribes a one-time listener for this signal. | OnceSignal
|  | addOnceWithPriority(listener:Function, priority:int = 0):ISlot Subscribes a one-time listener for this signal. | PrioritySignal
|  | addWithPriority(listener:Function, priority:int = 0):ISlot Subscribes a listener for the signal. | PrioritySignal
|  | dispatch(... valueObjects):void Dispatches an object to listeners. | OnceSignal
|  | remove(listener:Function):ISlot Unsubscribes a listener from the signal. | OnceSignal
|  | removeAll():void Unsubscribes all listeners from the signal. | OnceSignal

Protected Methods
Show Inherited Protected Methods
Show Inherited Protected Methods

| Method | Defined By
--- | --- | ---
|  | registerListener(listener:Function, once:Boolean = false):ISlot [override] | PrioritySignal
|  | registerListenerWithPriority(listener:Function, once:Boolean = false, priority:int = 0):ISlot | PrioritySignal
|  | registrationPossible(listener:Function, once:Boolean):Boolean | OnceSignal

Constructor Detail

PrioritySignal | () | Constructor

`public function PrioritySignal(... valueClasses)`

Parameters

| `... valueClasses`

Method Detail

addOnceWithPriority | () | method

`public function addOnceWithPriority(listener:Function, priority:int = 0):ISlot`

Subscribes 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.

Returns

| `ISlot` — a ISlot, which contains the Function passed as the parameter

Throws

| `flash.errors:IllegalOperationError` — `IllegalOperationError`: You cannot addOnce() then add() the same listener without removing the relationship first.
| `ArgumentError` — `ArgumentError`: Given listener is `null`.

addWithPriority | () | method |

`public function addWithPriority(listener:Function, priority:int = 0):ISlot`

Subscribes 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`)``

Returns

| `ISlot` — a ISlot, which contains the Function passed as the parameter

Throws

| `flash.errors:IllegalOperationError` — `IllegalOperationError`: You cannot addOnce() then add() the same listener without removing the relationship first.
| `ArgumentError` — `ArgumentError`: Given listener is `null`.

registerListener | () | method |

`override protected function registerListener(listener:Function, once:Boolean = false):ISlot`

Parameters

| `listener:Function`
| `once:Boolean` (default = `false`)``

Returns

| `ISlot`

registerListenerWithPriority | () | method |

`protected function registerListenerWithPriority(listener:Function, once:Boolean = false, priority:int = 0):ISlot`

Parameters

| `listener:Function`
| `once:Boolean` (default = `false`)``
| `priority:int` (default = `0`)``

Returns

| `ISlot`

Thu Jan 16 2014, 01:11 PM +08:00