![]() ![]() ![]() | |
![]() | |
![]() | |
![]() |
Buttons are actually four-frame interactive movie clips. When you select the button behavior for a symbol, Flash creates a Timeline with four frames. The first three frames display the button's three possible states; the fourth frame defines the active area of the button. The Timeline doesn't actually play; it simply reacts to pointer movement and actions by jumping to the appropriate frame.
To make a button interactive, you place an instance of the button symbol on the Stage and assign actions to the instance. You must assign the actions to the instance of the button in the document, not to frames in the button's Timeline.
Each frame in the Timeline of a button symbol has a specific function:
You can also create buttons using the ActionScript MovieClip object. See MovieClip class. You can add buttons to your document using button components. For more information on the PushButton and RadioButton components, see Button component.
For a lesson on creating buttons with ActionScript, select Help > How Do I > Quick Tasks > Write Scripts with ActionScript.
To create the button, you convert the button frames to keyframes.
Flash switches to symbol-editing mode. The Timeline header changes to display four consecutive frames labeled Up, Over, Down, and Hit. The first frame, Up, is a blank keyframe.
You can use a graphic or movie clip symbol in a button, but you cannot use another button in a button. Use a movie clip symbol if you want the button to be animated.
Flash inserts a keyframe that duplicates the contents of the Up frame.
The Hit frame is not visible on the Stage, but it defines the area of the button that responds when clicked. Make sure that the graphic for the Hit frame is a solid area large enough to encompass all the graphic elements of the Up, Down, and Over frames. It can also be larger than the visible button. If you do not specify a Hit frame, the image for the Up state is used as the Hit frame.
You can create a disjoint rollover, in which moving the pointer over a button causes another graphic on the Stage to change. To do this, you place the Hit frame in a different location than the other button frames.
![]() | |
![]() | |
![]() | |
![]() ![]() ![]() |