|
||||||
|
||||||
Tutorial: Creating Links within a Flash Movie
Free
Flash Tutorial
Step Seven: Attaching Actionscript to the First Button - Frame 1 Next ![]()
Now it is time to make the Buttons work. This is also done with ActionScript.
Note: When you click on the Keyframe (black dot) you will find that all the objects in that Frame are selected. In this case the objects are the text and the button. You know that objects are selected by the blue rectangles:
When attaching ActionScript to buttons it is important that only the button is selected otherwise the actions may get attached to the wrong object. Thus the first step is to de-select all the objects.
All the objects are now de-selected.
Only the Button is selected.
Important: If you have selected the button correctly the Actions Panel should say Actions - Button in the top left corner. In my experience beginners often make the error of attaching their ActionScript to the wrong object. Get into the habit of checking what the Actions Panel says in the top left corner:
![]()
Always Check what it says in the top left corner of the Actions Panel before applying Actions.Note: Script Assist should still be ticked:
>
on (release) {
gotoAndPlay(1);
}
This means that when the mouse button is released you will go to and Play Frame 1. You will need to make an adjustment so that the button takes you to Frame 2 and Stops.
![]()
The Button will now take you to Frame two and will Play.
Now you need to make sure the Movie does not animate by changing the Play to a Stop.
If you were to test the Movie this is what would happen:
Press the Button to test.
You will see that when pressed the Movie animates and returns all the way back to Frame 1 and stops.
Play means to animate so we need to get rid of the Play and replace it with a Stop.
This means that when the mouse button is released you will go to Frame 2 and Stop. Which is what is needed!
Click on your button. You should move to Frame 2 and Stop.
The buttons in Frame 2 will not work yet as you have yet to set the ActionScript for these.
|
Why not try out webwasp's new community. Meet new people, find friends in your area: Webwasp Mates & Dates
•
46569 visitors to this page since June 06 |
|
|
All material on this site is protected under international copyright © law. DO NOT reproduce any material from this site without written permission. Please ask as permission is often granted.
|