MC Tween: it saves the world.™

Home | Using MC Tween | Documentation | AS2 usage notes | Animation Types | Downloads | Examples | Extensions | Author & Disclaimer | Links

.frameTo()

Applies To

MovieClip

Availability

Flash 6 and above, using AS1 or AS2.

Usage

<MovieClip>.frameTo(frame [, seconds, animation type, delay, callback, extra1, extra2]);

Parameters

frame : Frame that the movieclip playhead must be moved to.

All other parameters are standard tween() related. Refer to the .tween() command for reference.

Returns

Nothing.

Description

Shortcut method; does a playback transition on a MovieClip, moving its playhead based on the animation type selected. This is useful to create different animation effects based on a timeline animation, usually a keyframe animation.

Also, a warning: while this works nicely to create frame seeking, it's not recommended if you're trying to create playback controls like backwards playing. In this case, it's faster and more accurate to use some simple onEnterFrame scripts to move the playhead back one frame per pass. Also, since frameTo() is based on an arbitrary execution time, it will skip and repeat frames as necessary. If you're building a timeline animation to be used with this method, try creating it with as many frames as possible for better playback.

Examples

// Rewinds a MovieClip to frame 1 in 0.5 seconds
<MovieClip>.frameTo(1, 0.5);

// Playbacks a Movieclip from start to finish in exactly 2 seconds
<MovieClip>.gotoAndStop(1);
<MovieClip>.frameTo(<MovieClip>._totalframes, 2, "linear");

MC Tween· Zeh Fernando, 2003-2006 · Proudly hosted at DreamHost · Disclaimer