Packagesystem.broadcasters
Classpublic class CoreBroadcaster
InheritanceCoreBroadcaster Inheritance Object
Implements Broadcaster, Lockable

This basic class is used to create concrete Broadcaster implementations. This class used composition with an internal Broadcaster object, by default a MessageBroadcaster reference.



Public Properties
 PropertyDefined By
  broadcaster : Broadcaster
[read-only] Indicates the Broadcaster reference used inside this composite Broadcaster.
CoreBroadcaster
  length : uint
[read-only] Indicates the number of listeners registered in the broadcaster.
CoreBroadcaster
Public Methods
 MethodDefined By
  
CoreBroadcaster(broadcaster:Broadcaster = null)
Creates a new CoreBroadcaster instance.
CoreBroadcaster
  
addListener(listener:*, priority:uint = 0, autoRemove:Boolean = false):Boolean
Registers an object to receive messages.
CoreBroadcaster
  
broadcastMessage(message:String, ... rest):*
Broadcast the specified message.
CoreBroadcaster
  
hasListener(listener:*):Boolean
Returns true if this dispatcher contains the specified listener.
CoreBroadcaster
  
isEmpty():Boolean
Returns true if the set of listeners is empty.
CoreBroadcaster
  
isLocked():Boolean
Returns true if the object is locked.
CoreBroadcaster
  
lock():void
Locks the object.
CoreBroadcaster
  
removeListener(listener:* = null):Boolean
Removes the specified listener or all listeners if the parameter is null.
CoreBroadcaster
  
setBroadcaster(broadcaster:Broadcaster = null):void
Sets the internal Broadcaster reference (default use MessageBroadcaster).
CoreBroadcaster
  
unlock():void
Unlocks the display.
CoreBroadcaster
Protected Methods
 MethodDefined By
  
Creates and returns the internal Broadcaster reference (this method is invoked in the constructor).
CoreBroadcaster
Property Detail
broadcasterproperty
broadcaster:Broadcaster  [read-only]

Indicates the Broadcaster reference used inside this composite Broadcaster.


Implementation
    public function get broadcaster():Broadcaster
lengthproperty 
length:uint  [read-only]

Indicates the number of listeners registered in the broadcaster.


Implementation
    public function get length():uint
Constructor Detail
CoreBroadcaster()Constructor
public function CoreBroadcaster(broadcaster:Broadcaster = null)

Creates a new CoreBroadcaster instance.

Parameters
broadcaster:Broadcaster (default = null) — The optional Broadcaster reference to use by composition in this 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
 
... rest

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.
initBroadcaster()method 
protected function initBroadcaster():Broadcaster

Creates and returns the internal Broadcaster reference (this method is invoked in the constructor).

Returns
Broadcaster
isEmpty()method 
public function isEmpty():Boolean

Returns true if the set of listeners is empty.

Returns
Booleantrue if the set of listeners is empty.
isLocked()method 
public function isLocked():Boolean

Returns true if the object is locked.

Returns
Booleantrue if the object is locked.
lock()method 
public function lock():void

Locks the object.

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.
setBroadcaster()method 
public function setBroadcaster(broadcaster:Broadcaster = null):void

Sets the internal Broadcaster reference (default use MessageBroadcaster).

Parameters

broadcaster:Broadcaster (default = null) — The Broadcaster reference used in this instance.

unlock()method 
public function unlock():void

Unlocks the display.