// cycle through all listener objects, listing all properties of each
listener object
for (var i:Number = 0; i < numListeners; i++) {
trace("Listener " + i + " listens for these events:");
for (item in someObject._listeners[i]) {
trace (" " + item + ": " + someObject._listeners[i][item]);
}
}
See also
initialize (AsBroadcaster.initialize method)
removeListener (AsBroadcaster.removeListener
method)
public removeListener(listenerObj:Object) : Boolean
Removes an object from the list of objects that receive event notification messages.
You can call this method only from an object that has been initialized by using the
AsBroadcaster.initialize()
Availability: ActionScript 1.0; Flash Player 6
Parameters
listenerObj:Object
notification from the broadcasting object.
Returns
- Returns
Boolean
true
Example
The following example shows how to remove a listener from the list of registered listeners.
The following code works if it is added to the first full example in the Examples section of the
AsBroadcaster.initialize()
that the number of registered listeners is reduced by one after calling the
method.
trace(someObject._listeners.length); // Output: 2
someObject.removeListener(myListener1);
trace(someObject._listeners.length); // Output: 1
method.
- The name of a listener object that is registered to receive event
if the listener object is removed, and
entry. The
false
statements are included only to verify
trace()
otherwise.
removeListener()
AsBroadcaster
271
Need help?
Do you have a question about the FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE and is the answer not in the manual?