Name
gotoAndPlay( ) Global Function — move the playhead to a given frame, then play the current clip or movie
Availability
Flash 2 and later
Synopsis
gotoAndPlay(frameNumber) gotoAndPlay(frameLabel) gotoAndPlay(scene, frameNumber) gotoAndPlay(scene, frameLabel)
Arguments
- frameNumber
A positive integer indicating the number of the frame to which the playhead of the current timeline should proceed before playing. If
frameNumberis less than 1 or greater than the number of frames in the timeline, the playhead is sent to either the first or last frame, respectively.
- frameLabel
A string indicating the label of the frame to which the playhead of the current timeline should proceed before playing. If
frameLabelis not found, the playhead is sent to the first frame of the timeline.
- scene
An optional string indicating the name of the scene that contains the specified
frameNumberorframeLabel. If not supplied, the current scene is assumed.
Description
When invoked without a scene argument,
gotoAndPlay( ) sends the playhead of the current
timeline to the frame specified by either the
frameNumber or
frameLabel and then plays the timeline
from that point. The “current timeline” is the movie clip
or movie from which the gotoAndPlay( ) function
is invoked.
If two arguments are specified in the gotoAndPlay(
) function call, the first argument is assumed to be the
scene. If only one argument is specified,
it is treated as a frameNumber or
frameLabel, and the current scene is
assumed.
When invoked with a scene ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access