# Targeting a sub-timeline

**URL:** <https://forum.kirupa.com/t/targeting-a-sub-timeline/2248>\
**Category:** flash\
**Created:** [May 6, 2002, 11:01pm UTC](https://forum.kirupa.com/t/targeting-a-sub-timeline/2248 "2002-05-06T23:01:17Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [May 6, 2002, 11:01pm UTC](https://forum.kirupa.com/t/targeting-a-sub-timeline/2248/1 "2002-05-06T23:01:17Z")

</div>

Hi,  
Stupid question. Let say I have a button on the main timeline. On press I want to gotoAndPlay say frame 15 of a movie clip called sub. Basically how do I target timelines that are not in the main timeline?  
Thanks a lot

Tim

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [May 7, 2002, 12:45am UTC](https://forum.kirupa.com/t/targeting-a-sub-timeline/2248/2 "2002-05-07T00:45:18Z")

</div>

if the button is in the \_root timeline and the ‘sub’ mc is in the \_root timeline, put these actions on the button:  
on(release){  
\_root.sub.gotoAndPlay(15);  
}  
🙂  
jeremy

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [May 7, 2002, 2:32am UTC](https://forum.kirupa.com/t/targeting-a-sub-timeline/2248/3 "2002-05-07T02:32:25Z")

</div>

Jeremy,

Right you are. You’ve helped me out a few times. Thanks alot. It’s much appreciated.

Take care,  
Tim

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [May 7, 2002, 3:55am UTC](https://forum.kirupa.com/t/targeting-a-sub-timeline/2248/4 "2002-05-07T03:55:47Z")

</div>

Here’s one for you before you ask the question. 😉

technicaly in that last example, the button would only need this.

on(release){  
sub.gotoAndPlay(17);  
}

the reason is, the button is on the main timeline along with the movie clip.

Now, if you were to have that same button, inside a movie clip, and you wanted it to talk to another movie clip… and both of those movie clips were on the main timeline you would have to use this

on(release){  
\_root.sub.gotoAndPlay(17);  
}

or this…

on(release){  
\_parent.sub.gotoAndPlay(17);  
}

the “\_root” tell the player to look at the main timline first, and then up the string of names until it gets to the one you want to control. The “\_parent” tells the player to look at the timeline that contains the timeline that this button is in, and then up the string of names until it gets to the one you want to control.
