Create a button with a button symbol – Adobe Flash Professional CC 2014 v.13.0 User Manual
Page 244
Note:
You can make a button that responds when a different area of the stage is clicked or rolled over (also called a disjoint rollover). Place
the Hit frame graphic in a different location than the other button frame graphics.
3. Associate an action with the button.
To make something happen when the user selects a button, you add ActionScript code to the Timeline. Place the ActionScript code in the
same frames as the buttons. The Code Snippets panel has pre-written ActionScript 3.0 code for many common button uses. See Add
interactivity with code snippets.
ActionScript 2.0 is not compatible with ActionScript 3.0. If your version of Flash uses ActionScript 3.0, you can’t paste ActionScript 2.0
code into your button (and vice versa). Before you paste ActionScript from another source into your buttons, verify that the version is
compatible.
Create a button with a button symbol
To make a button interactive, you place an instance of the button symbol on the Stage and assign actions to the instance. You assign the actions
to the root timeline of the FLA file. Do not add actions to the timeline of the button symbol. To add actions to the button timeline, use a movie clip
button instead.
1. Choose Edit > Deselect All, or click an empty area of the Stage to ensure that nothing is selected on the Stage.
2. Choose Insert > New Symbol.
3. In the Create New Symbol dialog box, enter a name. For the symbol Type, select Button.
Flash Pro switches to symbol-editing mode. The Timeline changes to display four consecutive frames labeled Up, Over, Down, and Hit. The
first frame, Up, is a blank keyframe.
4. To create the Up state button image, select the Up frame in the Timeline. Then use the drawing tools, import a graphic, or place an instance
of another symbol on the Stage.
You can use graphic symbols or movie clip symbols inside a button, but you cannot use another button symbol.
5. In the Timeline, click the Over frame, and then choose Insert > Timeline > Keyframe.
Flash Pro inserts a keyframe that duplicates the contents of the preceding Up frame.
6. With the Over frame still selected, change or edit the button image on the Stage to create the appearance you want for the Over state.
7. Repeat steps 5 and 6 for the Down frame and the optional Hit frame.
8. To assign a sound to a state of the button, select that state’s frame in the Timeline and choose Window > Properties. Then select a sound
from the Sound menu in the Property inspector. Only sounds you have already imported appear in the Sound menu.
9. When you finish, choose Edit > Edit Document. Flash returns you to the main timeline of your FLA file. To create an instance of the button
you created on the Stage, drag the button symbol from the Library panel to the Stage.
10. To test a button’s functionality, use the Control > Test command. You can also preview the states of a button symbol on the Stage by
choosing Control > Enable Simple Buttons. This command allows you to see the up, over, and down states of a button symbol without using
Control > Test.
237