AS3: going to specific frame label

Posted on 2009-04-19
Last Modified: 2013-11-12
i tried to specify a mouse click button for specific frame label.
the idea is:
when click a button for example 2, the play head plays from 31 to 45.
from there is jumps to the stored string witch is the name of the label

i get this error when i compile:
ArgumentError: Error #2109: Frame label root1 not found in scene Scene 1.
      at flash.display::MovieClip/gotoAndPlay()
      at main_fla::MainTimeline/frame45()
it says, there is no labels, but the label is there.

any help, thanks

// this code on frame 30


var nextSection:String = "";

section1.addEventListener(MouseEvent.CLICK, navigate, false, 0, true);

section2.addEventListener(MouseEvent.CLICK, navigate, false, 0, true);

section3.addEventListener(MouseEvent.CLICK, navigate, false, 0, true);

function navigate(evt:MouseEvent):void {

	addEventListener(Event.ENTER_FRAME, frameSection, false, 0, true);



function frameSection(evt:Event):void {

	if (currentFrame == 45) {

		nextSection =;




//this code on frame 45


Open in new window

Question by:Madkhali
    LVL 1

    Accepted Solution

    if you want to jump on a frame using frame label
    you can use this

    gotoAndStop("your frame lablel");
    LVL 6

    Author Comment

    thanks for your help
    i achieved the points you talked about

    my point is different, i need to to jump to stored label in the variable.

    the file is the first post, i use flash CS3

    Thanks again

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    There are times in your Flash CS4 application when you want more than a simple pointer or a hand, and it's hard to find an ideal walk-through to tell you what to do.  I spent a few days recently learning my way around making custom cursors in Flash,…
    In my long career of working as an actionscript developer, I had spent sleepless night often working hard to solve some small problems which actually took a lot of my development time; later found out the solutions to be a line or two. Here are s…
    The purpose of this video is to demonstrate how to Test the speed of a WordPress Website. Site Speed is an important metric of a site’s health. Slow site speed can result in viewers leaving your site quickly and not seeing your content. This…
    The purpose of this video is to demonstrate how to prevent comment spam on a WordPress Website. This will be demonstrated using a Windows 8 PC. Plugin Akismet will be used. Go to your WordPress login page. This will look like the following: myw…

    737 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    20 Experts available now in Live!

    Get 1:1 Help Now