Bloo Apple
Home Games and Movies

Games and Movies

Games and Movies Games and Movies
Latest Game
Pokemon Match
Coming Soon...
Droppin Beats 4
Paper Mario Maze
Want Action?
Join me on my next project to be part of something awesome
 
 
 
 
 

Controlling MovieClips

In actionscript 3.0 if you want to edit how the movie clip reacts inside a Movie Clip you can add functions to your document. I will provide an example and you can place the code in any actionscript 3.0 document's frame. Some Actions are gotoAndStop, gotoAndPlay, stop actions and next frame actions, previous frame actions, and play actions. I will provide examples in the code below. You can place the code inside the movie clip or outside the movieClip. If you place the code out side of the movieClip you need to tell what movie clip you want the action to run in. In this example I will name the movieClip "myMovieClip", without quotes.

stopAction

//inside a movieClip
//on Frame 1...
stop();

//outside on a frame
MovieClip(root).myMovieClip.gotoAndStop(5);

The Breakdown. In the first code you are placing the code on a frame, and when the frame reaches that frame it will execute the code. In this example the movie clip will stop on frame 1. OutSide of the variable you need to tell the program what you are going to modify (a movie clip), and it will be on the root timeline, and ofcourse we are editing inside of myMovieClip, and it will execute the action of stopping at frame 5 inside of that movieClip.

Site Created July 17, 2009