gotoAndStop()

Availability

Flash 1.0.

Usage

gotoAndStop([scene,] frame)

Operands

scene An optional string specifying the name of the scene to which the playhead is sent.

frame A number representing the frame number, or a string representing the label of the frame, to which the playhead is sent.

Description

Function; sends the playhead to the specified frame in a scene and stops it. If no scene is specified, the playhead is sent to the frame in the current scene.

You can use the scene parameter only on the root timeline, not within timelines for movie clips or other objects in the document.

Example

In the following example, when the user clicks a button to which gotoAndStop() is assigned, the playhead is sent to Frame 5 in the current scene, and the SWF file stops playing:

on(keyPress "8") {
    gotoAndStop(5);
}