Overriding the default framerate for a tween in Flash

by Peter deHaan on March 6, 2008

in Tween

The following example shows how you can override the default frame rate for a programmatic tween in Flash by setting the Tween object’s FPS property.

Full code after the jump.

// ActionScript 3.0
import fl.transitions.Tween;
import fl.transitions.easing.*;
 
var tween:Tween = new Tween(mc, "x", Elastic.easeOut, 0, 300, 3, true);
tween.FPS = 60;
 
mc.addEventListener(MouseEvent.CLICK, onClick);
 
function onClick(evt:MouseEvent):void {
    tween.start();
}

{ 2 comments… read them below or add one }

1 Anonymous 01.29.09 at 8:00 am

Thanks Peter

2 Adam 03.14.09 at 11:27 pm

Great Stuff, I have done many work arounds in the past to keep tweens smooth

Leave a Comment

You can use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="">

Previous post:

Next post: