A beginner's guide on simple buttons in Macromedia Flash.
In this tutorial, I will be talking about simple buttons:
Open up a new flash document.
Draw a black rectangle on the stage using the rectangle tool.
Select the rectangle if it isn't already selected using the selection tool and press F8.
For the name, enter "button" and for the symbol type, select "Button":
Press OK.
Now you have your very own button! Test your movie.
As you place your mouse over the button, the mouse icon will change into a pointing hand. This is all it can do so far, now it's time to add some more stuff to it.
Exit out of the testing screen and back to the stage.
Double click on the button to edit it.
Unlike the movie clip, the time line will be displayed like this in a button:
You will see "Up", "Down", "Over" and "Hit". I will go over each one.
Now, "Up" is self explanatory, when the button is idle it will display the "Up" state.
Now, add a keyframe underneath the "over" state:
Now, at the "Over" state key frame, change the rectangle's colour to yellow
Now, go back to scene 1 and test your movie
Put your mouse over your button. You will see that it will turn yellow. That is because of the "Over" state, once your mouse goes over the button, the button will display the "Over" state.
Go back inside the button. (Double click on the button in the library for the forgetful ones)
Now put a key frame under the "Down" state:
In the down state key frame, change the rectangle color to red.
Go back to scene 1 and test your movie.
Move your mouse over to the button, the button will turn yellow as expected. Now click the mouse. Clicking the mouse on the button will activate the "Down" state key frame if it has one, in this case the button will turn red.
Once more, go back into the button.
Add a key frame under "Hit" state.
Now, draw 4 rectangles, housing the original rectangle, like this:
Now, you won't actually get to see the hit state when testing your movie, but the "hit" state acts like a "remote" trigger, the content in the "hit" key frame is where the button can be pushed.
Test your movie, start from the outside and move your mouse in towards the rectangle. But before you reach it, the rectangle should turn yellow. That is because of the "hit" stage, that border you placed around the button means you can push and view the button from there. (In this picture, the "X" represents my mouse):
Congratulations, you have made a simple button. Although it looks like junk we will improve on this later on.