Packageorg.osflash.signals
Classpublic class DeluxeSignal
InheritanceDeluxeSignal Inheritance PrioritySignal Inheritance Signal Inheritance OnceSignal Inheritance Object

Signal dispatches events to multiple listeners. It is inspired by C# events and delegates, and by signals and slots in Qt. A Signal adds event dispatching functionality through composition and interfaces, rather than inheriting from a dispatcher. Project home: http://github.com/robertpenner/as3-signals/

Default MXML PropertyvalueClasses



Public Properties
 PropertyDefined By
 InheritednumListeners : uint
[read-only] The current number of listeners for the signal.
OnceSignal
  target : Object
DeluxeSignal
 InheritedvalueClasses : Array
An optional array of classes defining the types of parameters sent to listeners.
OnceSignal
Protected Properties
 PropertyDefined By
 Inheritedslots : SlotList
OnceSignal
  _target : Object
DeluxeSignal
 Inherited_valueClasses : Array
OnceSignal
Public Methods
 MethodDefined By
  
DeluxeSignal(target:Object = null, ... valueClasses)
Creates a DeluxeSignal instance to dispatch events on behalf of a target object.
DeluxeSignal
 Inherited
add(listener:Function):ISlot
Subscribes a listener for the signal.
Signal
 Inherited
addOnce(listener:Function):ISlot
Subscribes a one-time listener for this signal.
OnceSignal
 Inherited
addOnceWithPriority(listener:Function, priority:int = 0):ISlot
Subscribes a one-time listener for this signal.
PrioritySignal
 Inherited
addWithPriority(listener:Function, priority:int = 0):ISlot
Subscribes a listener for the signal.
PrioritySignal
  
dispatch(... valueObjects):void
[override] Dispatches an object to listeners.
DeluxeSignal
 Inherited
remove(listener:Function):ISlot
Unsubscribes a listener from the signal.
OnceSignal
 Inherited
removeAll():void
Unsubscribes all listeners from the signal.
OnceSignal
Protected Methods
 MethodDefined By
 Inherited
registerListener(listener:Function, once:Boolean = false):ISlot
[override]
PrioritySignal
 Inherited
registerListenerWithPriority(listener:Function, once:Boolean = false, priority:int = 0):ISlot
PrioritySignal
 Inherited
registrationPossible(listener:Function, once:Boolean):Boolean
OnceSignal
Property Detail
_targetproperty
protected var _target:Object

targetproperty 
target:Object


Implementation
    public function get target():Object
    public function set target(value:Object):void
Constructor Detail
DeluxeSignal()Constructor
public function DeluxeSignal(target:Object = null, ... valueClasses)

Creates a DeluxeSignal instance to dispatch events on behalf of a target object.

Parameters
target:Object (default = null) — The object the signal is dispatching events on behalf of.
 
... valueClasses — Any number of class references that enable type checks in dispatch(). For example, new DeluxeSignal(this, String, uint) would allow: signal.dispatch("the Answer", 42) but not: signal.dispatch(true, 42.5) nor: signal.dispatch() NOTE: Subclasses cannot call super.apply(null, valueClasses), but this constructor has logic to support super(valueClasses).
Method Detail
dispatch()method
override public function dispatch(... valueObjects):void

Dispatches an object to listeners.

Parameters

... valueObjects — Any number of parameters to send to listeners. Will be type-checked against valueClasses.


Throws
ArgumentError ArgumentError: Incorrect number of arguments.
 
ArgumentError ArgumentError: Value object is not an instance of the appropriate valueClasses Class.