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:

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

Property summary

Modifiers

Property

Description

_listeners:Array [read-only]

A list of references to all registered listener objects.

Properties inherited from class Object

constructor (Object.constructor property), __proto__ (Object.__proto__ property), prototype (Object.prototype property), __resolve (Object.__resolve property)


Method summary

Modifiers

Signature

Description

addListener(listenerObj:Object) : Boolean

Registers an object to receive event notification messages.

broadcastMessage(eventName:String) : Void

Sends an event message to each object in the list of listeners.

static

initialize(obj:Object) : Void

Adds event notification and listener management functionality to a given object.

removeListener(listenerObj:Object) : Boolean

Removes an object from the list of objects that receive event notification messages.

Methods inherited from class Object

addProperty (Object.addProperty method), hasOwnProperty (Object.hasOwnProperty method), isPropertyEnumerable (Object.isPropertyEnumerable method), isPrototypeOf (Object.isPrototypeOf method), registerClass (Object.registerClass method), toString (Object.toString method), unwatch (Object.unwatch method), valueOf (Object.valueOf method), watch (Object.watch method)