ahref.com > Guides > Design
Macromedia Flash Tutorial, Part II, Continued
Using Buttons to Get User Input
In Flash, buttons are the only direct way that you can get input from a user. A button is a special type of symbol with four frames in its timeline:
- The first frame ( the Up state) represents the default
state of a button--the button "at rest."
- The second frame (the Over state) determines the appearance of a button when a mouse is rolled over it. In Flash, you need to specify the part of the image that is "hot" (the area of the image that will change on mouseover). This area is called the hit area.
- The third frame (the Down
state) displays the appearance of the button when the mouse is
depressed (when a user clicks on it).
- The fourth frame (the Hit state) defines the
area or areas that will respond to the mouse on mouseover. Any graphics placed in the
button's fourth frame are used to map the hit area only. They will
never be visible in the animation.
You construct the first three frames as if you were creating a JavaScript mouseover. You will need to create three versions of an image to reflect the actions that will occur (at rest, mouseover, on mouse click). The fourth frame, the Hit state, works a little differently.
Start by removing any text and other decorative elements you might have copied into the Hit frame. All you'll need is a simple filled rectangle, oval, or other shape to define the area that you want
to react to the mouse. Make sure you use a solid color to fill your shape (not a gradient), and remove any line borders around your shape. Though most buttons will have the Up, Over, Down and Hit areas in the same place on the image, this is not required.
|