Eventdispatcher Class - MACROMEDIA FLASH MX 2004-USING COMPONENTS Use Manual

Using components
Hide thumbs Also See for FLASH MX 2004-USING COMPONENTS:
Table of Contents

Advertisement

Method summary for the EventDispatcher class
The following table lists the methods of the EventDispatcher class.
Method
EventDispatcher.addEventListener()
EventDispatcher.dispatchEvent()
EventDispatcher.removeEventListener()
EventDispatcher.addEventListener()
Availability
Flash Player 6 (6.0 79.0).
Edition
Flash MX 2004 and Flash MX Professional 2004.
Usage
componentInstance.addEventListener(event, listener)
Parameters
A string that is the name of the event.
event
A reference to a listener object or function.
listener
Returns
Nothing.
Description
Method; registers a listener object with a component instance that is broadcasting an event. When
the event occurs, the listener object or function is notified. You can call this method from any
component instance. For example, the following code registers a listener to the component
instance
myButton
myButton.addEventListener("click", myListener);
You must define the listener as either an object or a function before you call
addEventListener()
object, it must have a callback function defined that is invoked when the event occurs. Usually,
that callback function has the same name as the event with which the listener is registered. If the
listener is a function, the function is invoked when the event occurs. For more information, see
"Using listeners to handle events" on page
416
Chapter 6: Components Dictionary
:
to register the listener with the component instance. If the listener is an
Description
Registers a listener with a component instance.
Dispatches an event programmatically.
Removes an event listener from a component
instance.
56.

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLASH MX 2004-USING COMPONENTS and is the answer not in the manual?

Questions and answers

This manual is also suitable for:

Flash mx

Table of Contents