EasyManua.ls Logo

MACROMEDIA FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE - Nextframe Function; Nextscene Function

MACROMEDIA FLASH 8-ACTIONSCRIPT 2.0 LANGUAGE
1378 pages
Print Icon
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Loading...
Global Functions 79
nextFrame function
nextFrame() : Void
Sends the playhead to the next frame.
Availability: ActionScript 1.0; Flash Player 2
Example
In the following example, when the user presses the Right or Down arrow key, the playhead
goes to the next frame and stops. If the user presses the Left or Up arrow key, the playhead
goes to the previous frame and stops. The listener is initialized to wait for the arrow key to be
pressed, and the
init variable is used to prevent the listener from being redefined if the
playhead returns to Frame 1.
stop();
if (init == undefined) {
someListener = new Object();
someListener.onKeyDown = function() {
if (Key.isDown(Key.LEFT) || Key.isDown(Key.UP)) {
_level0.prevFrame();
} else if (Key.isDown(Key.RIGHT) || Key.isDown(Key.DOWN)) {
_level0.nextFrame();
}
};
Key.addListener(someListener);
init = 1;
}
See also
prevFrame function
nextScene function
nextScene() : Void
Sends the playhead to Frame 1 of the next scene.
Availability: ActionScript 1.0; Flash Player 2

Table of Contents

Related product manuals