Name
MovieClip.gotoAndPlay( ) Method — jump to a given frame, then play
Availability
Method form introduced in Flash 5 (global form supported by Flash 2 and later)
Synopsis
mc.gotoAndPlay(frameNumber) mc.gotoAndPlay(frameLabel)
Arguments
- frameNumber
A positive integer indicating the number of the frame to which the playhead of
mcshould jump before playing. IfframeNumberis less than 1 or greater than the number of frames inmc’s 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
mcshould jump before playing. IfframeLabelis not found, the playhead is sent to the first frame ofmc’s timeline.
Description
The MovieClip.gotoAndPlay( ) method is an
alternative to the global gotoAndPlay( )
function. Use the method form to control remote movie clips or
movies, specified by mc.
For general usage instructions, see the global gotoAndPlay(
) function.
Example
// Send the part1 clip to the label intro, then play part1
part1.gotoAndPlay("intro");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