Skip to main content
April 7, 2017
Question

How to stop scenes from playing one after the other?

  • April 7, 2017
  • 1 reply
  • 1394 views

Hey there

I created an opening scenes with button links to other scenes

I use this code to move to other scenes when clicking the buttons:

ames_room.addEventListener(MouseEvent.CLICK, fl_ClickToGoToScene);

function fl_ClickToGoToScene(event:MouseEvent):void

{

  MovieClip(this.root).gotoAndPlay(1, "Scene 4");

}

my problem is: I don't want flash to automatically continue to scene 2 but when I write a stop() action at the end of this scene, the button actions that link to other scenes stop to work

how should I write the stop action? or what should I do differently?

Thanks!

    This topic has been closed for replies.

    1 reply

    jeromiec83223024
    Inspiring
    April 11, 2017

    I don't do a lot of timeline scripting these days (this is honestly probably a better question for the Animate CC forum), but since stop() is a method on the MovieClip (assuming this is AS3), you probably need to do something like this.stop(); or this.root.stop(); if you're actually writing ActionScript as an action on the timeline of a playing child MovieClip.  I think in this instance, you're just calling an unimplemented local function called stop() that doesn't exist.  If you play the movie with the content debugger installed, I'd kind of expect it to throw a runtime error.