Flash CS3 Documentation |
|||
| Using ActionScript 2.0 Components > Creating Components > Creating the ActionScript class file > Adding component metadata > About the Event tag | |||
Use the Event tag to define events that the component emits.
This tag has the following syntax:
[Event("event_name")]
For example, the following code defines a click event:
[Event("click")]
Add the Event statements outside the class definition in the ActionScript file so that the events are bound to the class and not a particular member of the class.
The following example shows the Event metadata for the UIObject class, which handles the resize, move, and draw events:
...
import mx.events.UIEvent;
[Event("resize")]
[Event("move")]
[Event("draw")]
class mx.core.UIObject extends MovieClip {
...
}
To broadcast a particular instance, call the dispatchEvent() method. See Using the dispatchEvent() method.
Flash CS3
Send me an e-mail when comments are added to this page | Comment Report
Current page: http://livedocs.adobe.com/flash/9.0/main/00002500.html