Skip navigation
Currently Being Moderated

gotoAndPlay("frame name") won't work

Aug 19, 2009 2:23 PM

This is something I've never seen before.


I have a stop action in frame 1

I have a stop action in frame 53 which has a label "end" applied to it.


In the actionscript for frame one i have gotoAndPlay("end");

However, it just plays from frame 1.

If i do _root.gotoAndPlay("end"); i get nothing, nothing plays

If i do gotoAndPlay(53); it works locally but not online

if i do _root.gotoAndPlay(53); it works locally but not online.


I have no idea what's going on.I don't want to use frame numbers, but if that would work, at this point, i would use it.  Im using flash cs4, but I don't know as3 so I'm publishing in CS3 flash 10.


Any ideas?  Thanks!!


I attached a photo of my timeline.

  • Currently Being Moderated
    Aug 19, 2009 2:34 PM   in reply to optikalefxxxx

    I'm not a expert or anything but you could try using  a behavior.....just add a behavior to the frame and try both ways.....relative and use frame Number or try absolute and use a frame label....Hope this might help.....Sorry if not......just an idea....Is this As2 or As3??

    Mark as:
  • Currently Being Moderated
    Aug 19, 2009 2:58 PM   in reply to optikalefxxxx

    Creating in CS3 versus CS4 really doesn't make a difference... they will both publish AS2 and AS3 files.  Try commenting out that other code you have in frame 1 and see if that makes a difference.

    Mark as:
  • Currently Being Moderated
    Aug 19, 2009 3:21 PM   in reply to optikalefxxxx

    This is rather strange.


    Both  gotoAndPlay(53); and _root.gotoAndPlay(53); should definitely work at all times, (though I'd stay away from the former: there have been issues with using the function instead of the method for gotoAndPlay). If it works locally, it should most surely work online as player versions should not make any difference. Perhaps you saw a cached version of your movie online?


    gotoAndPlay("end"); and _root.gotoAndPlay("end");  should also both work, and again I advise avoiding the former choice. There are only two things that I can think of at the moment that could cause it to not work. Either, you have code before these function calls, preventing their execution. Or, maybe you have errored with the frame label? For instance, maybe you labeled the first frame "end" instead of the last frame? Or maybe both... but CS4 would tell you that you had done that.


    Very strange indeed.

    Mark as:
  • Currently Being Moderated
    Aug 19, 2009 9:14 PM   in reply to NSurveyor

    My guess would be that the whole file hasn't loaded by the time you call that so there is no way for the player to send the playhead to that frame.


    That would explain why it works locally, but not online.

    Mark as:
  • Currently Being Moderated
    Aug 19, 2009 9:22 PM   in reply to Rothrock

    Ah, of course. That is a much more sound argument. Of course I overlooked this since I haven't uploaded a flash movie with more than one frame, in a long long time

    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points