Skip to main content
July 2, 2008
Question

gotoAndPlay Scene Questions

  • July 2, 2008
  • 2 replies
  • 420 views
Hi,

I want to add actionscript to a button. When clicked, I want a scene to play. I am using the following code. It goes to the scene but then stops at the first frame. Any suggestions?

Thank you in advance for any assistance you can provide.

on (release) {
gotoAndPlay("Scene 2", 1);
}
This topic has been closed for replies.

2 replies

Inspiring
July 3, 2008
are you sure you are placing your code on a button? or have you replaced your code entirely with kglad's? you ought to be putting this code on your button:

on (release) {
_root.gotoAndPlay("scene2_frame1");
}

and don't forget to label the frame
kglad
Community Expert
Community Expert
July 2, 2008
don't use scene info in as2 and don't use the goto functions. use frame labels and the goto methods:

_root.gotoAndPlay("scene2_frame1"); // label this frame
July 3, 2008
Hi,

Thank you for your response. This is the error message I get when I use that code...

Statement must appear within on handler