| Package | org.osflash.signals.natives |
| Class | public class NativeRelaySignal |
| Inheritance | NativeRelaySignal Signal OnceSignal Object |
| Implements | INativeDispatcher |
| Subclasses | NativeMappedSignal |
Default MXML PropertyvalueClasses
| Property | Defined By | ||
|---|---|---|---|
| eventClass : Class
The class of event permitted to be dispatched. | NativeRelaySignal | ||
| eventType : String
The type of event permitted to be dispatched. | NativeRelaySignal | ||
![]() | numListeners : uint [read-only] The current number of listeners for the signal. | OnceSignal | |
| target : IEventDispatcher
The object considered the source of the dispatched events. | NativeRelaySignal | ||
| valueClasses : Array [override] | NativeRelaySignal | ||
| Property | Defined By | ||
|---|---|---|---|
| _eventClass : Class | NativeRelaySignal | ||
| _eventType : String | NativeRelaySignal | ||
![]() | slots : SlotList | OnceSignal | |
| _target : IEventDispatcher | NativeRelaySignal | ||
![]() | _valueClasses : Array | OnceSignal | |
| Method | Defined By | ||
|---|---|---|---|
NativeRelaySignal(target:IEventDispatcher, eventType:String, eventClass:Class = null)
Creates a new NativeRelaySignal instance to relay events from an IEventDispatcher. | NativeRelaySignal | ||
[override]
Subscribes a listener for the signal. | NativeRelaySignal | ||
[override]
Subscribes a one-time listener for this signal. | NativeRelaySignal | ||
addOnceWithPriority(listener:Function, priority:int = 0):ISlot
Subscribes a one-time listener for this signal. | NativeRelaySignal | ||
addWithPriority(listener:Function, priority:int = 0):ISlot
Subscribes a listener for the signal. | NativeRelaySignal | ||
dispatch(... valueObjects):void [override]
Dispatches an object to listeners. | NativeRelaySignal | ||
dispatchEvent(event:Event):Boolean
Unlike other signals, NativeRelaySignal does not dispatch null
because it causes an exception in EventDispatcher. | NativeRelaySignal | ||
[override]
Unsubscribes a listener from the signal. | NativeRelaySignal | ||
removeAll():void [override]
Unsubscribes all listeners from the signal. | NativeRelaySignal | ||
| Method | Defined By | ||
|---|---|---|---|
onNativeEvent(event:Event):void | NativeRelaySignal | ||
![]() | registerListener(listener:Function, once:Boolean = false):ISlot | OnceSignal | |
registerListenerWithPriority(listener:Function, once:Boolean = false, priority:int = 0):ISlot | NativeRelaySignal | ||
![]() | registrationPossible(listener:Function, once:Boolean):Boolean | OnceSignal | |
| _eventClass | property |
protected var _eventClass:Class| _eventType | property |
protected var _eventType:String| _target | property |
protected var _target:IEventDispatcher| eventClass | property |
eventClass:ClassThe class of event permitted to be dispatched. Will be flash.events.Event or a subclass.
public function get eventClass():Class public function set eventClass(value:Class):void| eventType | property |
eventType:StringThe type of event permitted to be dispatched. Corresponds to flash.events.Event.type.
public function get eventType():String public function set eventType(value:String):void| target | property |
target:IEventDispatcherThe object considered the source of the dispatched events.
public function get target():IEventDispatcher public function set target(value:IEventDispatcher):void| valueClasses | property |
valueClasses:Array[override] public function get valueClasses():Array public function set valueClasses(value:Array):void| NativeRelaySignal | () | Constructor |
public function NativeRelaySignal(target:IEventDispatcher, eventType:String, eventClass:Class = null)Creates a new NativeRelaySignal instance to relay events from an IEventDispatcher.
Parameterstarget:IEventDispatcher — An object that implements the flash.events.IEventDispatcher interface.
| |
eventType:String — The event string name that would normally be passed to IEventDispatcher.addEventListener().
| |
eventClass:Class (default = null) — An optional class reference that enables an event type check in dispatch().
Because the target is an IEventDispatcher,
eventClass needs to be flash.events.Event or a subclass of it.
|
| add | () | method |
override public function add(listener:Function):ISlotSubscribes a listener for the signal.
Parameters
listener:Function — A function with arguments
that matches the value classes dispatched by the signal.
If value classes are not specified (e.g. via Signal constructor), dispatch() can be called without arguments.
|
ISlot — a ISlot, which contains the Function passed as the parameter
|
flash.errors:IllegalOperationError — IllegalOperationError: You cannot addOnce() then add() the same listener without removing the relationship first.
| |
ArgumentError — ArgumentError: Given listener is null.
| |
ArgumentError — ArgumentError: Target object cannot be null.
|
| addOnce | () | method |
override public function addOnce(listener:Function):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 arguments
that matches the value classes dispatched by the signal.
If value classes are not specified (e.g. via Signal constructor), dispatch() can be called without arguments.
|
ISlot — a ISlot, which contains the Function passed as the parameter
|
flash.errors:IllegalOperationError — IllegalOperationError: You cannot addOnce() then add() the same listener without removing the relationship first.
| |
ArgumentError — ArgumentError: Given listener is null.
| |
ArgumentError — ArgumentError: Target object cannot be null.
|
| 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
|
flash.errors:IllegalOperationError — IllegalOperationError: You cannot addOnce() then add() the same listener without removing the relationship first.
| |
ArgumentError — ArgumentError: Given listener is null.
| |
ArgumentError — ArgumentError: Target object cannot be null.
|
| 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
|
flash.errors:IllegalOperationError — IllegalOperationError: You cannot addOnce() then add() the same listener without removing the relationship first.
| |
ArgumentError — ArgumentError: Given listener is null.
| |
ArgumentError — ArgumentError: Target object cannot be null.
|
| dispatch | () | method |
override public function dispatch(... valueObjects):voidDispatches an object to listeners.
Parameters
... valueObjects — Any number of parameters to send to listeners. Will be type-checked against valueClasses.
|
ArgumentError — ArgumentError: Event object expected.
| |
ArgumentError — ArgumentError: No more than one Event object expected.
| |
ArgumentError — ArgumentError: Target object cannot be null.
| |
ArgumentError — ArgumentError: Event object cannot be null.
| |
ArgumentError — ArgumentError: Event object [event] is not an instance of [eventClass].
| |
ArgumentError — ArgumentError: Event object has incorrect type. Expected [eventType] but was [event.type].
|
| dispatchEvent | () | method |
public function dispatchEvent(event:Event):BooleanUnlike other signals, NativeRelaySignal does not dispatch null because it causes an exception in EventDispatcher. Dispatches an event to listeners.
Parameters
event:Event — An instance of a class that is or extends flash.events.Event.
|
Boolean |
ArgumentError — ArgumentError: Target object cannot be null.
| |
ArgumentError — ArgumentError: Event object cannot be null.
| |
ArgumentError — ArgumentError: Event object [event] is not an instance of [eventClass].
| |
ArgumentError — ArgumentError: Event object has incorrect type. Expected [eventType] but was [event.type].
|
| onNativeEvent | () | method |
protected function onNativeEvent(event:Event):voidParameters
event:Event |
| registerListenerWithPriority | () | method |
protected function registerListenerWithPriority(listener:Function, once:Boolean = false, priority:int = 0):ISlotParameters
listener:Function | |
once:Boolean (default = false) | |
priority:int (default = 0) |
ISlot |
| remove | () | method |
override public function remove(listener:Function):ISlotUnsubscribes a listener from the signal.
Parameters
listener:Function |
ISlot — a ISlot, which contains the Function passed as the parameter
|
| removeAll | () | method |
override public function removeAll():voidUnsubscribes all listeners from the signal.