Adobe Flash Professional CS6 Adobe Flash Professional CS6 Classroom In A Book | Page 254

review Questions 1 How and where do you add ActionScript code? 2 How do you name an instance, and why is it necessary? 3 How can you label frames, and when is it useful? 4 What is a function? 5 What is an event? What is an event listener? 6 How do you create an animated button? review answers 1 ActionScript code resides in keyframes on the Timeline. Keyframes that contain ActionScript are indicated by a small lowercase “a.” You add ActionScript through the Actions panel. Choose Window > Actions, or select a keyframe and click the ActionScript panel icon in the Properties inspector, or right-click/Ctrl-click and select Actions. You enter code directly in the Script pane in the Actions panel, or you can select commands from the categories in the Actions toolbox. You can also add ActionScript through the Code Snippets panel. 2 To name an instance, select it on the Stage, and then type in the Instance Name field in the Properties inspector. You need to name an instance so that ActionScript can identify it with code. 3 To label a frame, select a keyframe on the Timeline, and then type a name in the Frame Label box in the Properties inspector. You can label frames in Flash to make it easier to reference frames in ActionScript and to give you more flexibility. 4 A function is a group of statements that you can refer to by name. Using a function makes it possible to run the same set of statements without having to type them repeatedly into the same script. When an event is detected, a function is executed in response. 5 An event is an occurrence that is initiated by a button click, a keystroke, or any number of inputs that Flash can detect and respond to. An event listener, also called an event handler, is a function that is executed in response to specific events. 6 Animated buttons display an animation in the Up, Over, or Down keyframes. To create an animated button, make an animation inside a movie clip symbol, and then place that movie clip symbol inside the Up, Over, or Down keyframes of a button symbol. When one of those button keyframes is displayed, the animation in the movie clip plays. Adobe FLAsh ProFessIonAL Cs6 CLAssroom In A book 245