User Guide
Using the on() event handler 79
To use the on() event handler:
1. Drag a User Interface component to the Stage.
For example, drag a Button component to the Sage.
2. On the Stage, select the component and open the Actions panel.
3. Add the on() handler to the Actions panel in the format:
on(event){
//your statements go here
}
For example:
on(click){
trace(this);
}
Flash runs the code inside the on() handler when the event for the on() handler occurs
(in this case, a button click).
4. Select Control > Test Movie and click the button to see the output.