View comments | RSS feed

EventDispatcher class

Events let your application know when the user has interacted with a component, and when important changes have occurred in the appearance or life cycle of a component--such as its creation, destruction, or resizing.

The methods of the EventDispatcher class let you add and remove event listeners so that your code can react to events appropriately. For example, you use the EventDispatcher.addEventListener() method to register a listener with a component instance. The listener is invoked when a component's event is triggered.

If you want to write a custom object that emits events that aren't related to the user interface, EventDispatcher is smaller and faster to use as a mix-in for UIComponent than UIEventDispatcher.

Related topics


Comments


dr.hc.solo said on Jul 8, 2005 at 5:48 AM :
Would have been nice to tell about calling initialize(theObjectToReceiveTheEventDispatchingMethods) for a custom component..

So if you want your custom component to work with event dispatching then call initialize(this) in your class constructor.

 

RSS feed | Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/flash/mx2004/main_7_2/00002441.html