Packagesystem.broadcasters
Classpublic class InternalBroadcaster
InheritanceInternalBroadcaster Inheritance Object
Implements Broadcaster
Subclasses FastDispatcher, MessageBroadcaster

This class provides a basic implementation of the Broadcaster interface.



Public Properties
 PropertyDefined By
  length : uint
[read-only] Indicates the number of listeners registered in the Broadcaster.
InternalBroadcaster
Protected Properties
 PropertyDefined By
  listeners : Vector.<BroadcasterEntry>
The Vector representation of all listeners.
InternalBroadcaster
Public Methods
 MethodDefined By
  
InternalBroadcaster(listeners:Array = null)
Creates a new InternalBroadcaster instance.
InternalBroadcaster
  
addListener(listener:*, priority:uint = 0, autoRemove:Boolean = false):Boolean
Registers an object to receive messages.
InternalBroadcaster
  
broadcastMessage(message:String, ... rest):*
Broadcast the specified message.
InternalBroadcaster
  
hasListener(listener:*):Boolean
Returns true if this dispatcher contains the specified listener.
InternalBroadcaster
  
isEmpty():Boolean
Returns true if the set of listeners is empty.
InternalBroadcaster
  
removeListener(listener:* = null):Boolean
Removes the specified listener or all listeners if the parameter is null.
InternalBroadcaster
  
toArray():Array
Returns the Array representation of all listeners.
InternalBroadcaster
Property Detail
lengthproperty
length:uint  [read-only]

Indicates the number of listeners registered in the Broadcaster.


Implementation
    public function get length():uint
listenersproperty 
protected var listeners:Vector.<BroadcasterEntry>

The Vector representation of all listeners.

Constructor Detail
InternalBroadcaster()Constructor
public function InternalBroadcaster(listeners:Array = null)

Creates a new InternalBroadcaster instance.

Parameters
listeners:Array (default = null) — The Array collection of listeners to initialize in the broadcaster.
Method Detail
addListener()method
public function addListener(listener:*, priority:uint = 0, autoRemove:Boolean = false):Boolean

Registers an object to receive messages.

Parameters

listener:* — The listener to register.
 
priority:uint (default = 0) — Determinates the priority level of the listener.
 
autoRemove:Boolean (default = false) — Apply a removeListener after the first trigger

Returns
Booleantrue If the listener is register in the broadcaster.
broadcastMessage()method 
public function broadcastMessage(message:String, ... rest):*

Broadcast the specified message.

Parameters

message:String — The message to broadcast.
 
... rest — Optional parameters passed in with the broadcast message.

Returns
*
hasListener()method 
public function hasListener(listener:*):Boolean

Returns true if this dispatcher contains the specified listener.

Parameters

listener:*

Returns
Booleantrue if this dispatcher contains the specified listener.
isEmpty()method 
public function isEmpty():Boolean

Returns true if the set of listeners is empty.

Returns
Booleantrue if the set of listeners is empty.
removeListener()method 
public function removeListener(listener:* = null):Boolean

Removes the specified listener or all listeners if the parameter is null.

Parameters

listener:* (default = null)

Returns
Booleantrue if the specified listener exist and can be removed.
toArray()method 
public function toArray():Array

Returns the Array representation of all listeners.

Returns
Array — the Array representation of all listeners.