Packagesystem.signals
Classpublic class Signal
InheritanceSignal Inheritance InternalSignal Inheritance Object
Subclasses Logger

This class provides a fast Signaler implementation.

Example :

     package examples 
     {
         import system.signals.Signal ;
         
         import flash.display.Sprite;
         import flash.events.Event;
         
         [SWF(width="740", height="480", frameRate="24", backgroundColor="#666666")]
         
         public class SignalExample extends Sprite
         {
             public function SignalExample()
             {
                 var signal:Signal = new Signal() ;
                 
                 signal.connect( write ) ;
                 
                 signal.emit( "hello world" ) ; // hello world
                 signal.emit( "thank you" ) ; // thank you
             }
             
             public function write( message:String ):void
             {
                 trace( message ) ;
             }
         }
     }
     



Public Properties
 PropertyDefined By
 Inheritedlength : uint
[read-only] Indicates the number of receivers connected.
InternalSignal
 Inheritedtypes : *
Determinates the optional Array representation of all valid types of this signal.
InternalSignal
Protected Properties
 PropertyDefined By
 Inheritedreceivers : Vector.<SignalEntry>
The Array representation of all receivers.
InternalSignal
Public Methods
 MethodDefined By
  
Signal(types:Array = null, receivers:Array = null)
Creates a new Signal instance.
Signal
 Inherited
checkValues(values:Array):void
Checks all values passed-in the emit method.
InternalSignal
 Inherited
connect(receiver:*, priority:uint = 0, autoDisconnect:Boolean = false):Boolean
Connects a Function or a Receiver object.
InternalSignal
 Inherited
connected():Boolean
Returns true if one or more receivers are connected.
InternalSignal
 Inherited
disconnect(receiver:* = null):Boolean
Disconnect the specified object or all objects if the parameter is null.
InternalSignal
  
emit(... values):void
[override] Emit the specified values to the receivers.
Signal
 Inherited
hasReceiver(receiver:*):Boolean
Returns true if the specified receiver is connected.
InternalSignal
 Inherited
toArray():Array
Returns the Array representation of all receivers connected with the signal.
InternalSignal
 Inherited
toVector():Vector.<Function>
Returns the Vector representation of all receivers connected with the signal.
InternalSignal
Constructor Detail
Signal()Constructor
public function Signal(types:Array = null, receivers:Array = null)

Creates a new Signal instance.

Parameters
types:Array (default = null) — An optional Array who contains any number of class references that enable type checks in the "emit" method. If this argument is null the "emit" method not check the types of the parameters in the method.
 
receivers:Array (default = null) — The Array collection of receiver objects to connect with this signal.
Method Detail
emit()method
override public function emit(... values):void

Emit the specified values to the receivers.

Parameters

... values — All values to emit to the receivers.