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

(Help) Button clicking go to the next scene and play

New Here ,
Apr 07, 2021 Apr 07, 2021

Copy link to clipboard

Copied

  • Hello I am creating a short story for my Uni project and I have two characters which I inserted them as buttons. I want when someone clicks on them to go on seperate scenes. I have given different names to these scenes. So I am inserting the code for each character and when I test the movie, when I click on each character it just repeats the scene from the start.
  • Ps: on the end of all frames I have put stop so the one interacting with the movie has time to choose. Maybe it's because of it? 

 

  • Also I have tried inserting a specific Frame rate this doesn't work either. 

I am putting the code which I used for one of my buttons.

/* Click to Go to Scene and Play

Clicking on the specified symbol instance plays the movie from the specified scene and frame.

 

Instructions:

1. Replace "Scene 3" with the name of the scene you would like play.

2. Replace 1 with the frame number you would like the movie to play from in the specified scene.

*/

 

zaxra.addEventListener(MouseEvent.CLICK, fl_ClickToGoToScene_2);

 

function fl_ClickToGoToScene_2(event:MouseEvent):void

{

  •  MovieClip(this.root).gotoAndPlay(1, "spitiz");

}

 

Thank you so much! 

TOPICS
ActionScript , Error , How to , Timeline

Views

2.0K

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 ,
Apr 07, 2021 Apr 07, 2021

Copy link to clipboard

Copied

1. is this an as3 project.  (that's as3 code and won't work if it's an html5/canvas project.)

2. you need some button or movieclip on stage (when that code executes) with instance name (in the properties panel) zaxra.

3. you need a scene named "spitiz".  if that's the current scene, it will replay.

4. any error messages when testing?

 

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
New Here ,
Apr 07, 2021 Apr 07, 2021

Copy link to clipboard

Copied

Thank you I made it work with adding a esperate layer named stop and putting the code there! 

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 ,
Apr 07, 2021 Apr 07, 2021

Copy link to clipboard

Copied

LATEST

you're welcome 

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