addListener (AsBroadcaster.addListener method)

public addListener(listenerObj:Object) : Boolean

Registers an object to receive event notification messages. This method is called on the broadcasting object and the listener object is sent as an argument.

Availability: ActionScript 1.0; Flash Player 6

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)