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

the action for scenes instead of frames

Contributor ,
Sep 06, 2024 Sep 06, 2024

hello there

i am using this code for multiple buttons in the same frame, the inicial frame, in order to jump to any other frame when i press the button...

button_name.addEventListener(MouseEvent.CLICK, launch_button1);
function launch_button1(event:MouseEvent):void
{
gotoAndPlay(1); // plays the current timeline from Frame 1 of Scene 1
}

is there an action for instead of going to frame to go to the scene......an action for scenes similar to this ?

 

 

also about the home button

whats the action script for home button to come back to the first scene?

anyone?

108
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 ,
Sep 06, 2024 Sep 06, 2024
LATEST

Hi.

 

Just add the scene name as the second paramater of the gotoAndPlay or gotoAndStop methods.

 

gotoAndPlay(1, "Scene 2");

 


The names of the scenes must be the ones you see in the Scene panel.

image.png
For the home button, you would pass 1 as the frame and the name of the first scene.

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