ActionScript.org Flash, Flex and ActionScript Resources - http://www.actionscript.org/resources
Controlling Different Timelines
http://www.actionscript.org/resources/articles/37/1/Controlling-Different-Timelines/Page1.html
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. 
By Evgueni Strok
Published on September 9, 2005
 
Written By: Evgueni Strok [email:[email protected]]
Difficulty Level: Beginning
Requirements: Flash 5

Page 1 of 1
Written By: Evgueni Strok [email:[email protected]]
Difficulty 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"

[as]on (release) {
_root.MCtest.gotoAndStop(25);
}[/as]

Button2 -- "label Hi"

[as]on (release) {
_root.MCtest.gotoAndStop("Hi");
}[/as]

Button3 -- "play"

[as]on (release) {
_root.MCtest.play();
}[/as]
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.