Skip to main content
Participant
September 4, 2011
Question

link to frame isnt working?

  • September 4, 2011
  • 1 reply
  • 209 views

I'm trying to simply link to another frame. In the file, when the down arrow is pressed in the 2nd layer (frame 21) I want it to play starting at frame 30, labeled "to 3". I've tried this code:

on(press) {
    gotoAndPlay("to3");
}

but it doesnt seem to work, and thats quite confusing, since this same code worked in the down arrow in frame 1, and when clicked, the clip at frame 10 began playing. I dont know what is wrong. Please suggest possible problems, and look at the original file. How do I attach the file, I cant find anything that allows me to do so...

This topic has been closed for replies.

1 reply

kglad
Community Expert
Community Expert
September 5, 2011

your frame label "to 3" is not the same as the gotoAndPlay() argument "to3".

in addition, you shouldn't have code attached to objects and you should not use the goto functions, use the goto methods:

var tl:MovieClip=this;

yourbtn.onPress=function(){

tl.gotoAndPlay("to 3");  // if that's the correct label in the timeline that contains this code.

}