gotoAndPlay()

Availability

Flash 2.

Usage

gotoAndPlay([scene,] frame)

Parameters

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.

Returns

Nothing.

Description

Function; sends the playhead to the specified frame in a scene and plays from that frame. If no scene is specified, the playhead goes to the specified frame in the current scene.

Example

When the user clicks a button to which gotoAndPlay() is assigned, the playhead is sent to Frame 16 in the current scene and starts to play.

on(release) {
  gotoAndPlay(16);
}

See also

MovieClip.gotoAndPlay()