Flash 8 Documentation |
|||
| ActionScript 2.0 Language Reference > ActionScript classes > AsBroadcaster | |||
Object
|
+-AsBroadcaster
public class AsBroadcaster
extends Object
Provides event notification and listener management capabilities that you can add to user-defined objects. This class is intended for advanced users who want to create custom event handling mechanisms. You can use this class to make any object an event broadcaster and to create one or more listener objects that receive notification anytime the broadcasting object calls the broadcastMessage() method.
There is no constructor function for the AsBroadcaster class. To use this class, follow this process:
AsBroadcaster.initialize(obj:Object) method, where the obj parameter is the name of the object that you selected to be the broadcaster.myBroadcaster.addListener(myListener), where myBroadcaster is the name of the event broadcaster object and myListener is the name of the listener object. Each event broadcaster stores a list of listener objects to be notified when a message is broadcast. Use the addListener() method to add listeners to the list, and use removeListener() to remove listeners from the list.myBroadcaster.broadcastMessage(eventName:String) method, where myBroadcaster is the name of the event broadcaster and eventName is the name of the event that matches the name of the listener method.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.
Availability: ActionScript 1.0; Flash Player 6
|
Modifiers |
Property |
Description |
|---|---|---|
|
|
_listeners |
A list of references to all registered listener objects. |
Properties inherited from class Object
|
Modifiers |
Signature |
Description |
|---|---|---|
|
|
addListener |
Registers an object to receive event notification messages. |
|
|
broadcastMessage |
Sends an event message to each object in the list of listeners. |
|
|
initialize |
Adds event notification and listener management functionality to a given object. |
|
|
removeListener |
Removes an object from the list of objects that receive event notification messages. |
Methods inherited from class Object addProperty, hasOwnProperty, isPropertyEnumerable, isPrototypeOf, registerClass, toString, unwatch, valueOf, watch
Version 8
RSS feed | Send me an e-mail when comments are added to this page | Comment Report
Current page: http://livedocs.adobe.com/flash/8/main/00001921.html
Comments
mihnea_dev said on Sep 30, 2005 at 5:09 PM : Kanundrum said on Oct 21, 2005 at 11:30 PM : Kanundrum said on Oct 23, 2005 at 11:47 AM : No screen name said on Jan 31, 2006 at 3:52 PM : kavelle said on Jun 1, 2006 at 12:30 AM : UsmanH said on Jun 19, 2006 at 5:21 AM : re:hush said on Mar 2, 2007 at 6:09 AM :