Adobe Flash Professional CS6 Adobe Flash Professional CS6 Classroom In A Book | Page 234
garygari_btn.addEventListener(MouseEvent.CLICK, restaurant2);
function restaurant2(event:MouseEvent):void {
gotoAndStop(20);
}
ilpiatto_btn.addEventListener(MouseEvent.CLICK, restaurant3);
function restaurant3(event:MouseEvent):void {
gotoAndStop(30);
}
pierreplatters_btn.addEventListener(MouseEvent.CLICK,
restaurant4);
function restaurant4(event:MouseEvent):void {
gotoAndStop(40);
}
actionScript Commands
for navigation
The following list contains the ActionScript codes for common navigation com-
mands. Use these codes when you create buttons to stop the playhead, start the
playhead, or move the playhead to different frames on the Timeline. The gotoAnd-
Stop and gotoAndPlay commands require additional information, or arguments,
within their parentheses as indicated.
•
•
•
•
•
•
stop();
play();
gotoAndStop(framenumber or "framelabel");
gotoAndPlay(framenumber or "framelabel");
nextFrame();
prevFrame();
Checking syntax and formatting code
ActionScript can be very picky, and a single misplaced period can cause your entire
project to grind to a halt. Fortunately, the Actions panel provides a few tools to
help you identify errors and fix them.
1 Select the first frame of your actions layer and open the Actions panel if it is not
already open.
Adobe FLAsh ProFessIonAL Cs6 CLAssroom In A book
225