A Flash Developer Resource Site

Results 1 to 10 of 10

Thread: gotoAndPlay from mc to main timeline

Hybrid View

  1. #1
    Junior Member
    Join Date
    Nov 2009
    Posts
    5

    Exclamation gotoAndPlay from mc to main timeline

    I'm trying to play a frame label that is on the main timeline by clicking on a button inside of a movieclip.

    Here is the error I'm getting. I most definitely have a page1 label on the frame.
    Code:
    ArgumentError: Error #2109: Frame label page1 not found in scene Scene1.
        at flash.display::MovieClip/gotoAndStop()
        at site_fla::Navbarslider_5/btn1()

    Here is my button code:

    Code:
    button1.addEventListener(MouseEvent.CLICK,btn1);
    function btn1(e:MouseEvent):void {
        MovieClip(parent).gotoAndStop("page1");
    }
    Any help is appreciated.

  2. #2
    Junior Member
    Join Date
    May 2009
    Posts
    13
    Hey loganbest,

    Honestly I cannot see anything wrong with your code
    Unless you miss typed "page1" or put the code in the wrong place (It should be inside the movieClip) everything looks fine to me.

    Anyway, I attached a working solution so go ahead and see where your problem is
    Attached Files Attached Files

  3. #3
    Junior Member
    Join Date
    Nov 2009
    Posts
    5
    yea so I tried all that and it's the same error when applied to my swf.

    I'm attaching my fla so if you get a chance to look at it that'd be awesome..

    The button code is in the navslider mc on the first frame.
    Attached Files Attached Files

  4. #4
    Member
    Join Date
    Sep 2008
    Posts
    80
    change it from
    MovieClip(parent).gotoAndStop("page1");

    to
    (root as MovieClip).gotoAndStop("page1");

  5. #5
    Junior Member
    Join Date
    Nov 2009
    Posts
    5
    Tried that many moons ago. It's just not finding the clearly visible frame label and it's pissing me off.

  6. #6
    Member
    Join Date
    Sep 2008
    Posts
    80
    and it's still giving you that error??that's weird. did you name the frame properly in the main stage?

  7. #7
    Junior Member
    Join Date
    Nov 2009
    Posts
    5
    Yes it is labelled properly, and the frame labels I have in the mc work fine but it wont go to any on the main timeline..

  8. #8
    Member
    Join Date
    Sep 2008
    Posts
    80
    Quote Originally Posted by loganbest View Post
    Yes it is labelled properly, and the frame labels I have in the mc work fine but it wont go to any on the main timeline..
    did you check all your labels if you have them properly and they are being called in the right place

  9. #9
    Member
    Join Date
    Sep 2008
    Posts
    80
    if that stilll giving you error, send me a simple attached file that i could run to test it. i couldn't run your attached file becus it's missing some files.

  10. #10
    Junior Member
    Join Date
    Nov 2009
    Posts
    5
    so now the weird thing is, I think flash doesn't like the label "page1" because I changed it to something else and it works fine...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center