
Programming Buttons with Frame Scripts
Basic Interactivity
435
1 //Pause the movie on frame 1
2 stop();
3 // code-hint comments
4 // SimpleButton enterBtn;
5 // event handlers
6 function handleClick( pEvent:MouseEvent
):void
7 {
8 if( pEvent.target == enterBtn )
9 {
10 // handle the event
11 nextFrame();
12 }
13 }
Script 15.4 The completed event handler.
Figure 15.18 As you enter code in the Script pane,
the code-hint window offers possible code items
you might want. When the item you want appears
highlighted, press Enter, and it gets added to the
Script pane.
6.
Position the pointer at the end of line 9
(after the opening brace), press Enter ...