MovieClip.gotoAndPlay( ) Method

ActionScript for Flash MX: The Definitive Guide, 2nd Edition
By Colin Moock
Chapter 18.  ActionScript Language Reference
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( )



    ActionScript for Flash MX. The Definitive Guide
    ActionScript for Flash MX: The Definitive Guide, Second Edition
    ISBN: 059600396X
    EAN: 2147483647
    Year: 2002
    Pages: 780
    Authors: Colin Moock

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net