# How to using frame label from a movie clip to gotoAndStop to stage frame?

**URL:** <https://forum.kirupa.com/t/how-to-using-frame-label-from-a-movie-clip-to-gotoandstop-to-stage-frame/264956>\
**Category:** Uncategorized\
**Created:** [July 2, 2008, 2:27pm UTC](https://forum.kirupa.com/t/how-to-using-frame-label-from-a-movie-clip-to-gotoandstop-to-stage-frame/264956 "2008-07-02T14:27:45Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![gofat](https://avatars.discourse-cdn.com/v4/letter/g/35a633/32.png) [@gofat](https://forum.kirupa.com/u/gofat)\
**Post date:** [July 2, 2008, 2:27pm UTC](https://forum.kirupa.com/t/how-to-using-frame-label-from-a-movie-clip-to-gotoandstop-to-stage-frame/264956/1 "2008-07-02T14:27:45Z")

</div>

I have a 100-frame movie clip, a\_mc, on the stage.  
I want it automatically gotoAndStop at a certain frame, labeled as “about”, on the stage (root level).  
How should I do?  
(AS3 version please…)

I know how to do this from a root to control a movie clip only. ☹

---

<div class="post-metadata">

**Author:** ![johnlouis](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/johnlouis/32/568_2.png) [@johnlouis](https://forum.kirupa.com/u/johnlouis)\
**Post date:** [July 2, 2008, 2:56pm UTC](https://forum.kirupa.com/t/how-to-using-frame-label-from-a-movie-clip-to-gotoandstop-to-stage-frame/264956/2 "2008-07-02T14:56:06Z")

</div>

a\_mc.gotoAndStop(“about”); ?

---

<div class="post-metadata">

**Author:** ![senocular](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/senocular/32/7217_2.png) [@senocular](https://forum.kirupa.com/u/senocular)\
**Post date:** [July 2, 2008, 3:05pm UTC](https://forum.kirupa.com/t/how-to-using-frame-label-from-a-movie-clip-to-gotoandstop-to-stage-frame/264956/3 "2008-07-02T15:05:08Z")

</div>

[QUOTE=johnlouis;2352462]a\_mc.gotoAndStop(“about”); ?[/QUOTE]

That would go to the “about” label in the a\_mc timeline. To go to “about” in the root (main) timeline, you would need to call gotoAndStop from root.

if you’ve written your code in the main timeline, this could be as simple as _gotoAndStop(“about”);_, but if you’re calling from another location (i.e. within the a\_mc timeline) then you’ll need to specify root directly.

```auto
root.gotoAndStop("about");

```

However, this will only work if the timeline you’ve written that script in is visible and on the active display list. It might not work if you created an instance of that movie clip dynamically with ActionScript (since you need to be on the display list for the root property to correctly reference the root timeline, otherwise its null).

---

<div class="post-metadata">

**Author:** ![gofat](https://avatars.discourse-cdn.com/v4/letter/g/35a633/32.png) [@gofat](https://forum.kirupa.com/u/gofat)\
**Post date:** [July 2, 2008, 3:59pm UTC](https://forum.kirupa.com/t/how-to-using-frame-label-from-a-movie-clip-to-gotoandstop-to-stage-frame/264956/4 "2008-07-02T15:59:35Z")

</div>

[quote=senocular;2352466]That would go to the “about” label in the a\_mc timeline. To go to “about” in the root (main) timeline, you would need to call gotoAndStop from root.

if you’ve written your code in the main timeline, this could be as simple as _gotoAndStop(“about”);_, but if you’re calling from another location (i.e. within the a\_mc timeline) then you’ll need to specify root directly.

ActionScript Code:  
[LEFT]root.[COLOR=#0000ff]gotoAndStop[/COLOR]COLOR=#000000[/COLOR];[/LEFT]

However, this will only work if the timeline you’ve written that script in is visible and on the active display list. It might not work if you created an instance of that movie clip dynamically with ActionScript (since you need to be on the display list for the root property to correctly reference the root timeline, otherwise its null).[/quote]

Thank you so much for reply.

I want it jupms to the “about” label in the main timeline after a\_mc plays to the end. (There is no a\_mc at “about” label key frame.)

I inserted a keyframe at the end of my a\_mc and added this code:  
root.[COLOR=#0000ff]gotoAndStop[/COLOR]COLOR=#000000[/COLOR];

However, there was an error: 1061: Call to a possibly undefined method gotoAndStop through a reference with static type flash.display: DisplayObject.

It automatically go to the “about” label in the main timeline even a\_mc is not playing to the end. I guess maybe because Flash calls the action to root at the first priority no matter where this code is?? I wish I could better explain…

---

<div class="post-metadata">

**Author:** ![yaim0310](https://avatars.discourse-cdn.com/v4/letter/y/85e7bf/32.png) [@yaim0310](https://forum.kirupa.com/u/yaim0310)\
**Post date:** [July 2, 2008, 6:11pm UTC](https://forum.kirupa.com/t/how-to-using-frame-label-from-a-movie-clip-to-gotoandstop-to-stage-frame/264956/5 "2008-07-02T18:11:39Z")

</div>

You would need to type cast root so it knows for sure that it indeed has the gotoAndStop function

```auto
MovieClip(root).gotoAndStop("about");

```

---

<div class="post-metadata">

**Author:** ![senocular](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/senocular/32/7217_2.png) [@senocular](https://forum.kirupa.com/u/senocular)\
**Post date:** [July 2, 2008, 8:48pm UTC](https://forum.kirupa.com/t/how-to-using-frame-label-from-a-movie-clip-to-gotoandstop-to-stage-frame/264956/6 "2008-07-02T20:48:30Z")

</div>

[QUOTE=yaim0310;2352558]You would need to type cast root so it knows for sure that it indeed has the gotoAndStop function

```auto
MovieClip(root).gotoAndStop("about");

```

[/QUOTE]

whoops, forgot about that, thanks 😉

---

<div class="post-metadata">

**Author:** ![gofat](https://avatars.discourse-cdn.com/v4/letter/g/35a633/32.png) [@gofat](https://forum.kirupa.com/u/gofat)\
**Post date:** [July 2, 2008, 8:58pm UTC](https://forum.kirupa.com/t/how-to-using-frame-label-from-a-movie-clip-to-gotoandstop-to-stage-frame/264956/7 "2008-07-02T20:58:58Z")

</div>

[quote=yaim0310;2352558]You would need to type cast root so it knows for sure that it indeed has the gotoAndStop function

```auto
MovieClip(root).gotoAndStop("about");

```

[/quote]

Thanks a lot, yaim.  
It works! 😃
