Name
MovieClip.gotoAndStop( ) Method — jump to a given frame, and stop the playhead
Availability
Method form introduced in Flash 5 (global form supported by Flash 2 and later)
Synopsis
mc.gotoAndStop(frameNumber) mc.gotoAndStop(frameLabel)
Arguments
- frameNumber
A positive integer indicating the number of the frame to which the playhead of
mcshould jump. 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. IfframeLabelis not found, the playhead is sent to the first frame ofmc’s timeline.
Description
The MovieClip.gotoAndStop( ) method is an
alternative to the global gotoAndStop( )
function. Use the method form to control remote movie clips or main
movies specified by mc.
For general usage instructions, see the global gotoAndStop(
) function.
Example
// Send the mainMenu clip to frame 6 and stop the playhead there
mainMenu.gotoAndStop(6);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