flash animation video tutorials

 

 

 

START LEARNING
FLASH NOW

Get instant access to over
45 minutes of FREE Flash tutorials on video
 and our newsletter.

Name:
E-Mail:
Phone:
Describe

.

.

.

 
Web video-animation.com

.

.

flash tutorials flash tutorials flash tutorials flash tutorials

Flash 8 Controlling a MovieClip

This tutorial will explain how to control the timeline of a movieclip using a couple of buttons. It is very basic but can be extended for more advanced Actionscript usage. So let us commence:
Create a new flash 8 file.
Click menu item Instert - New Symbol (Control + F8).
Tick MovieClip, give it a name such as square_mc.
Draw a square in the MovieClip Editing window.
Select the square, hit key F8 , tick Graphic, and call it square_gr.
Click on frame 20 and hit key F6 to create a new keyframe.
On frame 20 move the square or rotate, or do what you will to change it.
Right click on frame 10, for example, and select Create Motion Tween.

Flash Tutorials in Video Format - Watch them now at LearnFlash.com  

Insert a new layer in the square_mc MovieClip Editing window and call it actions.
Click on frame 1 of the actions layer and create a new keyframe (F6).
Click on frame 20 of the actions layer and create a new keyframe (F6).
Click on frame 1 of the actions layer and hit F9 to open the Actionscript window.
Type in a stop command.


stop();

Click on frame 20 of the actions layer and put a stop command on that frame as well.

stop();

Go back to the main timeline, and drag the square_mc MovieClip from the library to the stage.
Select the square_mc and in the Properties window give it an instance name like square_mc.
Rename the layer to square and lock it.
Create a new layer and name it buttons.
Go to Window - Common Libraries - Buttons and choose a playback button.
Drag a play and a stop button to the stage. (They will go on the buttons layer of course)
Give these buttons instance names of play_btn and stop_btn.
Lock the buttons layer.

N.B. Always lock your layers when you are not using them.

Create a new layer and name it actions. Lock it.
Select frame 1, actions layer and open the actions window (F9).
Put this code in :

stop();
play_btn.onRelease = function(){
	square_mc.gotoAndPlay(2);
}
stop_btn.onRelease = function(){
	square_mc.gotoAndStop(1);
}

What does this code do? When the play button is pressed the movieclip playhead is sent to frame 2 to play and it continues until frame 20, where it stops. Remember that the square-mc MovieClip has a stop() command on frame 1 and 20. That causes the Movieclip to stay at frame 1 when it is loaded.
The stop button causes the playhead of the MovieClip to go back to frame 1 where it will encounter the stop() command and stop.
This tutorial does not do much but it shows how you can control a MovieClip using buttons or you can use other means such as a keystroke or other events. Expand on it for your own uses and the main thing is to know what you are doing and to be able to control it. My last piece of advice is to keep it simple.

.

flash 8