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

Why my actionscript to go to certain scene not working?

Community Beginner ,
Jan 28, 2022 Jan 28, 2022

Hello, Im still new to adobe animate and I wish I could get assistance on how to solve this problem.

I created three different scene and I want the buttons that I created on Scene 1 be able to navigate to Scene 2 and Scene 3. So I click on the button , choose action script To go to Scene and play and input the scene number I want the button to navigate. However it not working and I keep getting errors. Is there anything I can do to solve this? And what could I miss here? 

 

this is Scene 1 with button and I want the Food Pyramid button to go to Scene 2expand image

this is Scene 2expand imagethe input I didexpand image

 

Really appreciate for any help !

2.1K
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 ,
Jan 28, 2022 Jan 28, 2022

Hi.

 

It's probably because your second scene has only one frame and you're using gotoAndPlay. So when you click the button the navigation immediately go forth and back.

 

To solve this, put a stop method in the first frame of the second scene or use gotoAndStop.

 

Please let us know.

 

Regards,

JC

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 ,
Jan 28, 2022 Jan 28, 2022

Thanks! I just put some frames on Scene 2 then run the code Go to Scene and Play. However encountered an error with the lines below : 

ArgumentError: Error #2108: Scene Scene 2 was not found.
at flash.display::MovieClip/gotoAndPlay()
at wani_Scene1_fla::MainTimeline/fl_ClickToGoToScene_4()

 

what could be the problem and is there I should not miss to properly run this?

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 ,
Jan 28, 2022 Jan 28, 2022

It's not finding "Scene 2".

 

Do you mind showing your Scene panel (Shift + F2)?

 

And how are you testing your movie?

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 ,
Jan 28, 2022 Jan 28, 2022

here my scene panel 

scene 4.pngexpand image

 

and I test the scene by clicking Test Scene .

I try to run the "Test" only but it run to other scenes and I still figure out how to put the stop(); since there's many layers and I don't know which frames to put the action script stop(); 

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 ,
Jan 28, 2022 Jan 28, 2022

i put my .fla here in case it not visible in the screenshot . I hope this is okay

 

https://drive.google.com/file/d/1U9ZqeT2MrwNRstEz1eDpjk1DYE3wrxXD/view?usp=sharing

 

 

Very thankful because you have helped a lot in this!

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 ,
Jan 28, 2022 Jan 28, 2022

Thanks.

 

Here it is:

https://drive.google.com/file/d/1LGsljxDZiBXcMjRtkxVjN5L52BBSb_56/view?usp=sharing

 

You need to use the defaul Test command (Ctrl/Cmd + Enter). If you use the Test Scene command, only the current scene will be exported.

 

I hope it helps.

 

Regards,

JC

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 ,
Jan 28, 2022 Jan 28, 2022

Omg thanks sm a million thanks ! Im very happy it finally works. Spent hours to figure out this and you really help me on this. Even prepare the other buttons ..Thanks sm! Im really troubling you in this. May this year lots of good things happen to you.

 

I see the code now and will study on it 🙂

Thought I need to redo things from start since my friends said I should do frames instead of by scene..

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 ,
Jan 28, 2022 Jan 28, 2022

Awesome! You're welcome!

 

Scenes are really not recommended for most cases, but for the level of complexity your project has so far, I think you'll be OK.

 

Regards,

JC

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 ,
Jan 29, 2022 Jan 29, 2022

I agree with JoãoCésar.

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 ,
Jan 29, 2022 Jan 29, 2022
LATEST

This is pretty cool.

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