This is my code:
play_mc.onRelease= function ()
{
GotoAndPlay ("Scene 3",1)
}
I get the following error:
Error 1180 Call to a possibly undefined method gotoAndPlay
Why is this?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You are trying to call a method on a MovieClip object. Which is ‘play_mc’ in this case. The first letter is lower case and the type signature for the method is the following:
So you should actually have gotoAndPlay(1, “Scene 3”);
Finally, If you are using AS2 you should use the this keyword to call the method if you want gotoAndPlay to run on ‘play_mc’. Otherwise, if you leave it out the method will run on the main timeline. So I would keep that in mind.
Also, if you are on AS3 you should use addEventHanlder. Either solution makes it more clear on the scope of the method being called and makes the code more flexible.
Here is the MovieClip AsDoc
Here is the Reference to AS3 Event Handling