Move Between Different Scenes with ActionScript 3
Many complicated Flash Movies have more than one scene. This Flash ActionScript tutorial shows how to move or navigate between different scenes.Flash Tutorial Content:
For some long and complex Flash animations, I like to split them into some scenes (e.g. Scene 1, Scene 2, Scene 3, etc.). You can use a more meaningful Scene name instead of number if you like. This Flash Actioncript tutorial shows how to moving between different scenes.
The completed Flash Movie of this ActionScript tutorial is shown as above. Please play around to see how it works.
Flash ActionScript Codes:
//This is Scene 1 Codes
stop();
// Go To Frame 1 of Scene 2 and Play Button
playScene2_btn.addEventListener(MouseEvent.CLICK, playScene2);
function playScene2(evt:Event) {
gotoAndPlay(1, "Scene 2");
}
// Go To Frame 1 of Scene 2 and Stop Button
stopScene2_btn.addEventListener(MouseEvent.CLICK, stopScene2);
function stopScene2(evt:Event) {
gotoAndStop(1, "Scene 2");
}
// This is Scene 2 Codes:
// Go To Frame 1 of Scene 1 and Stop Button
gotoScene1_btn.addEventListener(MouseEvent.CLICK, gotoScene1);
function gotoScene1(evt:Event) {
gotoAndStop(1, "Scene 1");
}
Download Flash Source File:
Remarks:
This Flash ActionScript tutorial shows how to navigate or move between different scenes of Movieclip.