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

Why my actionscript to go to certain scene not working?

Community Beginner ,
Jan 28, 2022 Jan 28, 2022

Copy link to clipboard

Copied

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? 

 

scene.png

scene2.pngscene3.png

 

Really appreciate for any help !

Views

873

Translate

Translate

Report

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

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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?

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

It's not finding "Scene 2".

 

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

 

And how are you testing your movie?

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

here my scene panel 

scene 4.png

 

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(); 

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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!

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

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

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

I agree with JoãoCésar.

Votes

Translate

Translate

Report

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

Copy link to clipboard

Copied

LATEST

This is pretty cool.

Votes

Translate

Translate

Report

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