Skip to main content
Inspiring
June 3, 2019
Question

"go to previous scene" script not working on scene 2

  • June 3, 2019
  • 1 reply
  • 968 views

Hello, I'm a relatively new animator still trying to figure out the ropes, especailly when it comes to actionscript. I am creating a simple interactive flash with 2 scenes and 2 buttons for navigating them. On the first scene i successfully put the code in for "go to next scene" into one button and "go to previous scene" in the other( which just starts scene 1 over again as i expected. However. When Try to assign these to the same buttons in scene 2 its like the script gets ignored and clicking the buttons does nothing. Anyone out there got any tips or know what I'm doing wrong?                 I am using animate CC, btw

This topic has been closed for replies.

1 reply

Ned Murphy
Legend
June 3, 2019

What does your Actionscript code look like?  How do you incorporate the code?  Is there a reason you want to use scenes?

If the buttons are identical between the two scenes, then consider just having one scene, using the timeline to divide up what you have as scenes.  Then you could have the buttons on one layer (just two for the whole timeline).

RomanpenAuthor
Inspiring
June 4, 2019

button_1.addEventListener(MouseEvent.CLICK, fl_ClickToGoToPreviousScene_11);

function fl_ClickToGoToPreviousScene_11(event:MouseEvent):void

{

MovieClip(this.root).prevScene();

}

I'm going to try what you said with one scene, thanks for that btw! However, is there anything in this code that is wrong? I took it directly from the "actionscript" folder

Ned Murphy
Legend
June 5, 2019

I don't know how things fare with Animate these days when it comes to using scenes, but back in the days of Flash, scenes were best avoided as they were frequently troublesome to navigate with no determinable reason why.  So avoiding them just became a standard approach for a lot of people.