Start Stop Movieclips in Flash
How to control Flash Movieclip symbols using actionscript
While working with Movieclips in Flash you will find it necessary to start and stop the animation at runtime. In this Flash tutorial you'll learn how to control Movieclips using basic actionscript code. Movieclips can be easily controlled using Flash actionscript and the instance name of the Movieclip symbol is used to control it using Actionscript commands.
Compatible Versions of Flash for this Tutorial
Flash MX 2004 & below | Flash 8 | Flash CS3 | Flash CS4Note: For uses of lower versions of Flash some visual interface images would differ.
Recommended Version: Adobe Flash CS4 Professional
Follow the steps given below:
Controlling Movieclips using Actionscript
- Create a Movieclip (Refer the Flash Photo Masking tutorial for this example) with some animation and name the instance say, 'mask_mc'.
- Create a Button for Start and Stop action of the movieclip and name them as 'start_btn' and 'stop_btn' respectively.
- Write the following Actionscript code for the 2 Buttons as given below:
- Save your work and test the Movie (Ctrl + Enter). Thats it you have learnt how to control movieclips in Flash using Actionscript.
Start Button
on(press)
{
mask_mc.play();
}
Stop Button
on(press)
{
mask_mc.stop();
}
Fig: Start & Stop Movieclip using Actionscript
We would love to hear your comments and any suggestions on future tutorials we can add to this section. Thanks!
Bookmark and Share this web page.
Sponsored Link(s):