-
Need help please...
Ok....
I'm not new to Flash, but I am new to AS3 and it's been a while since I scripted anything in Flash. The problem I'm having is with an error I keep getting.
"Call to a possibly undefined method gotoAndPlay...blah blah blah" I'm sure you guys now this one pretty well. What I don't understand is that my script makes complete sense, yet it won't work. All I'm trying to do is a simple rollover on a movie button.
Here's my script:
//HOME BUTTON
btn1.addEventListener(MouseEvent.CLICK, btn1func);
function btn1func(event: MouseEvent)
{
gotoAndPlay("HomeStart");
}
btn1.addEventListener(MouseEvent.MOUSE_OVER, btn1Over);
function btn1Over(event:MouseEvent)
{
btn1.gotoAndPlay("in");
}
There it is. All I'm telling it to do is to go into the movie button and play, but it won't. It keeps saying that the problem is with the line of code that says btn1.gotoAndPlay("in")
Please help, because I'm seriously going crazy. I really don't feel like restarting my website from scratch in AS2.
Thanks
-
Senior Member
If your button is based on the SimpleButton class then gotoAndPlay does not exist as a method for this class.
- The right of the People to create Flash movies shall not be infringed. -
-
So what are my options? And how do I know if it's a simple button? Sorry, but I'm very confused. I just might have to revert to AS2.
Last edited by Nosfer; 04-29-2008 at 11:58 AM.
-
Senior Member
You must have created a library symbol:MovieClip, Button or Graphic. The option is to use a MovieClip instead. Also in your script change
btn1.gotoAndPlay("in");
to
event.currentTarget.gotoAndPlay("in");
- The right of the People to create Flash movies shall not be infringed. -
-
So how do I create a MovieClip that's not a library symbol? Sorry for all these noob questions btw.....it's just that it's hard to find any explanation that doesn't sound too technical.
-
Ok....I tried the new scipt and got a different error.
ReferenceError: Error #1069: Property gotoAndPlay not found on flash.display.SimpleButton and there is no default value.
at PaintingSite_fla::MainTimeline/btn1Over()
I give up.....I'm gonna go back to AS2 and start from scratch. AS3 is just too picky.
Thanks for the help.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|