User Guide

AsBroadcaster 267
Parameters
listenerObj:Object - The name of the listener object that receives event notification.
Returns
Boolean - Although this method technically returns a Boolean value, in practical terms it
returns
Void because it always returns the value true.
Example
The following example is an excerpt from the full example provided in the entry for the
AsBroadcaster.initialize() method.
someObject.addListener(myListener1); // Register myListener1 as listener.
someObject.addListener(myListener2); // Register myListener2 as listener.
See also
initialize (AsBroadcaster.initialize method), removeListener
(AsBroadcaster.removeListener method)
broadcastMessage
(AsBroadcaster.broadcastMessage method)
public broadcastMessage(eventName:String) : Void
Sends an event message to each object in the list of listeners. When the message is received by
the listening object, Flash Player attempts to invoke a function of the same name on the
listening object. Suppose that your object broadcasts an event message like this:
obj.broadcastMessage("onAlert");
When this message is received, Flash Player invokes a method named onAlert() on the
receiving listener object.
You can call this method only from an object that was initialized by using the
AsBroadcaster.initialize() method.
Availability: ActionScript 1.0; Flash Player 6
NOTE
You can pass arguments to your listener functions by including additional arguments to
the
broadcastMessage() method. Any arguments that appear after the eventName
parameter are received as arguments by the listener method.