tailieunhanh - Adobe Flash chuyên nghiệp - p 24

keyframes. To reference frame labels in ActionScript, you must enclose them in quotation marks. The command gotoAndStop("label1") makes the playhead go to the keyframe with the label called label1. 1 Select frame 10 on the content layer. 2 In the Properties inspector, enter label1 in the Label Name field. A tiny flag icon appears on each of the keyframes that have labels. 3 Select frame 20 on the content layer. 4 In the Properties inspector, enter label2 in the Label Name field. 5 Select frames 30 and 40, and in the Properties inspector, enter corresponding names in the Label Name field: label3. | keyframes. To reference frame labels in ActionScript you must enclose them in quotation marks. The command gotoAndStop label1 makes the playhead go to the keyframe with the label called label1. 1 Select frame 10 on the content layer. 2 In the Properties inspector enter labell in the Label Name field. A tiny flag icon appears on each of the keyframes that have labels. 3 Select frame 20 on the content layer. 4 In the Properties inspector enter label2 in the Label Name field. 5 Select frames 30 and 40 and in the Properties inspector enter corresponding names in the Label Name field label3 and label4. A tiny flag icon appears on each of the keyframes that have labels. 6 Select the first frame of the actions layer and open the Actions panel. ADOBE FLASH PROFESSIONAL CS5 CLASSROOM IN A BOOK 221 Download from Library of Wow ebook 7 In your ActionScript code change all the fixed frame numbers in each of the gotoAndStopO commands to the corresponding frame labels gotoAndStop 10 should be changed togotoAndStop label1 gotoAndStop 20 should be changed to gotoAndStop label2 gotoAndStop 30 should be changed togotoAndStop label3 gotoAndStop 40 should be changed to gotoAndStop label4 The ActionScript code now directs the playhead to a particular frame label instead of a particular frame number. 8 Test your movie by choosing Control Test Movie in Flash Professional. Each button moves the playhead to a different labeled keyframe on the Timeline where a different movie clip is displayed. The user can choose to see any restaurant in any order. However since the restaurant information covers the buttons you can t return to the original menu screen to choose another restaurant. You ll need to provide another button to return to the first frame which you ll do in the next section. Creating a Home Button A home button simply makes the playhead go back to the first frame of the Timeline or to a keyframe where an original set of choices or the main menu are presented to the viewer. Creating