Copy link to clipboard
Copied
Hello i know this question was before i checked most of the answers but it didn't helped me so i have this piece of code witch should get me on the scene2.So when i am pressing the proper button to go on the next scene (witch i don't get why i have to pressed twice) this error pop out:
TypeError: Error #1006: gotoAndStopscene2 is not a function.
at almost11_scene1_fla::MainTimeline/fl_ClickToGoToScene()
this is the code that i used it:
btn_bricks.addEventListener(MouseEvent.CLICK, fl_ClickToGoToScene);
function fl_ClickToGoToScene(e:MouseEvent):void
{
MovieClip(this.root).gotoAndStopscene (1,"scene2");
};
I have done it to work once but it was working only with the debugger still had to press twice but it was going on the second scene and from there further but unfortunately i don't remember what i was changing but i am more than sure that it was this part :"MovieClip(this.root).gotoAndStopscene (1,"scene2");​"
I would love to make it work as soon as possible so please it's there someone who can actually figure it out what or where it's wrong ???
If you use Ctrl + Alt + Enter, Animate will only export the "scene1". The "scene2" won't be exported and therefore won't be available. So if your code try to access "scene2", you will get that error.
The default shortcut for testing a movie is Ctrl + Enter. Try to always use it.
Your file is correct. You're only using the wrong shortcut.
Got it?
Copy link to clipboard
Copied
Thank you for sharing your knowledge with me but still waiting to see the answer to that file why it's not working why that error ![]()
Copy link to clipboard
Copied
If you use Ctrl + Alt + Enter, Animate will only export the "scene1". The "scene2" won't be exported and therefore won't be available. So if your code try to access "scene2", you will get that error.
The default shortcut for testing a movie is Ctrl + Enter. Try to always use it.
Your file is correct. You're only using the wrong shortcut.
Got it?
Copy link to clipboard
Copied
For real
)) =))) that is so annoying because I spent 4 days to check each frame and action if it's in there thank you for your help that saved me from doing another one from the beginning u are awesome good to learn from mistakes omg thank you a lot
:X !!!!
Copy link to clipboard
Copied
Excellent!
You're welcome! ![]()
Copy link to clipboard
Copied
One other tip, if you turn on Permit Debugging in the Publish Settings, the error will then tell you which frame and which line has the problem:

Copy link to clipboard
Copied
Thank you Colin that’s a good tip as well thank you so much guys for your help .
Get ready! An upgraded Adobe Community experience is coming in January.
Learn more