Table of Contents

MovieClip.gotoAndPlay( ) Method Flash 5

jump to a given frame, then play the movie or clip
mc.gotoAndPlay(frameNumber)
mc.gotoAndPlay(frameLabel)

Arguments

frameNumber

A positive integer indicating the number of the frame to which the playhead of mc should jump before playing. If frameNumber is less than 1, the call to MovieClip.gotoAndPlay( ) is ignored. Note that this behavior differs from the global version of gotoAndPlay( ), where a value less than 1 is treated as 1. If frameNumber is greater than the number of frames in mc's timeline, the playhead is sent to the last frame.

frameLabel

A string indicating the label of the frame to which the playhead of mc should jump before playing. If frameLabel is not found, the operation fails silently. This behavior differs from the global version of gotoAndPlay( ), where a missing frame label is treated as frame 1.

Description

The MovieClip.gotoAndPlay( ) method is an alternative to the global gotoAndPlay( ) function. Use the MovieClip 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_mc clip to the label intro, then play part1_mc
part1_mc.gotoAndPlay("intro");

See Also

gotoAndPlay( ), MovieClip.gotoAndStop( )


Table of Contents