User Guide

268 ActionScript classes
Parameters
eventName:String - The name of the event to broadcast. The name of any listener methods
must match this parameter in order to receive the broadcast event. You can pass arguments to
the listener methods by including additional arguments after
eventName.
Example
The following example is an excerpt from the first full example provided in the entry for the
AsBroadcaster.initialize() method:
someObject.broadcastMessage("someEvent"); // Broadcast the "someEvent"
message.
The following example is an excerpt from the second full example provided in the entry for
the
AsBroadcaster.initialize() method. It shows how to send arguments to listener
methods.
someObject.broadcastMessage("someEvent", 3, "arbitrary string");
See also
initialize (AsBroadcaster.initialize method), removeListener
(AsBroadcaster.removeListener method)
initialize (AsBroadcaster.initialize method)
public static initialize(obj:Object) : Void
Adds event notification and listener management functionality to a given object. This is a
static method; it must be called by using the AsBroadcaster class (where
someObject is the
name of the object to be initialized as an event broadcaster):
AsBroadcaster.initialize(someObject);
This method adds the _listeners property along with the following three methods to the
object specified by the
obj parameter:
obj.addListener()
obj.removeListener()
obj.broadcastMessage()
Availability: ActionScript 1.0; Flash Player 6
NOTE
A common mistake is to capitalize the second letter of AsBroadcaster. When calling the
AsBroadcaster.initialize() method, ensure that the second letter is lowercase. Any
misspelling of
AsBroadcaster fails silently.