Nextframe() - MACROMEDIA FLASH MX 2004-ACTIONSCRIPT LANGUAGE Reference

Actionscript language reference
Table of Contents

Advertisement

nextFrame()

Availability
Flash 2.
Usage
nextFrame() : Void
Parameters
None.
Returns
Nothing.
Description
Function; sends the playhead to the next frame.
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
variable is used to prevent the listener from being redefined if the playhead returns to
init
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;
}
ActionScript Language Reference
CHAPTER 2
nextFrame()
645

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the FLASH MX 2004-ACTIONSCRIPT LANGUAGE and is the answer not in the manual?

Questions and answers

This manual is also suitable for:

Flash mx

Table of Contents