Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Change scene

Community Beginner ,
Apr 10, 2018 Apr 10, 2018

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 ???

TOPICS
ActionScript
2.5K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Apr 12, 2018 Apr 12, 2018

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?

Translate
Community Beginner ,
Apr 12, 2018 Apr 12, 2018

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

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 12, 2018 Apr 12, 2018

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?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Apr 12, 2018 Apr 12, 2018

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 !!!!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Apr 12, 2018 Apr 12, 2018

Excellent!

You're welcome!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Apr 12, 2018 Apr 12, 2018

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:

Screen Shot 2018-04-12 at 9.20.47 AM.png

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Beginner ,
Apr 12, 2018 Apr 12, 2018
LATEST

Thank you  Colin that’s a good tip as well thank you so much guys for your help .

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines