Make button load scene once the current scene is done
I've been looking everywhere on how to do this, and can't find anything!
So, I have this code right here -
button1.addEventListener(MouseEvent.CLICK, goScene2);
function goScene2(event:MouseEvent):void {
gotoAndPlay(1,"Scene 2");
}
So, lets say scene 1 has 40 frames. Someone clicks on the button to go to the next scene at frame 10. I want it to continue to frame 40, then change to the next scene.
Keep in mind that the 40 frame scene is on loop, so it could loop 4 or 5 times, then someone clicks next scene. So, I want it to finish the loop, then go to the next scene.