|
||||||||||||||
. . . . . |
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:
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. 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.
Create a new layer and name it actions. Lock it.
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. . |
|
||||||||||||
|
. | Home | Flash MX | Actionscript 2.0 | Flash 3D | Flash 8 | Flash Database | Flash Mobile | Flash CS3 | Java For Kids | Video Course | General Video | Photoshop | Web Design | Digital Photography | Games | free backgrounds | Resume | Streaming Video | Students Work | Links | Contact me | sitemap | reviews | . . |
||||||||||||||