Controlling Different Timelines

Page 1 of 1
Evgueni Strok
This user is yet to take control of their account and provide a biography. If you are the author of this article, please contact us via support AT actionscript DOT org.
View all articles by Evgueni StrokDifficulty Level: Beginning
Requirements: Flash 5 Download FLA
One question we see on the forums very often is: "I have a Movie Clip and I want to control it from the main TimeLine, or another movieclip. How can I do it?" The solution is to use the appropriate Path (see the tutorial) to the movieclip. This tutorial provides a step by step example.
Create an MC and 3 buttons and put all of them on main TimeLine

Button1 -- "frame 25"
Button2 -- "label Hi"
Button3 -- "play"
MC -- "MC main" -- (instance name=MCtest)
Take a look inside MC main:

And remember to add instance name (MCtest) to MC

How it works
Using 3 different buttons we'll tell MC to go to different frames of MC TimeLine by number of frame , label of frame and play MC after MC has been stopped.
Button1 -- "frame 25"
on (release) {
_root.MCtest.gotoAndStop(25);
}
Button2 -- "label Hi"
on (release) {
_root.MCtest.gotoAndStop("Hi");
}
Button3 -- "play"
on (release) {
_root.MCtest.play();
}
The main Timeline always has the name _root. Target paths are hierarchical addresses of movie clip instance names (MCtest --- in our case), variables, and objects in a movie. You can name a movie clip instance in the Instance panel.

