
Basic Interactivity
445
Modifying and Extending Button Scripts
Figure 15.23 When you select a frame that contains
actions, the script for that frame appears in the
Actions panel.
6 function handleClick( pEvent:MouseEvent
):void
7 {
8 if( pEvent.target == enterBtn )
9 {
10 // handle the event
11 nextFrame();
12 trace( “Click! New frame: “ +
currentFrame );
13 }
14 }
Script 15.6 Adding the trace action to the event
handler.
Modifying and Extending
Button Scripts
When it comes to scripting, the rst steps
are often the most di cult; subsequent steps
expand on what you’ve already learned.
Earlier, you set up a frame script that controls
a but ...