/ Published in: ActionScript 3
Using easing with the API that comes with Flash.
Expand |
Embed | Plain Text
import fl.transitions.*; import fl.transitions.easing.*; //More info //http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/fl/transitions/easing/package-detail.html stage.frameRate = 31; var box:Sprite = new Sprite(); box.graphics.beginFill(Math.random() * 0xFFFFFF); box.graphics.drawRect(0, 0, 100, 350); box.graphics.endFill(); box.x = 50; box.y = 10; addChild(box); var startValue:Number = box.x; var finishValue:Number = 400; var duration:Number = 3; var myTween:Tween = new Tween(box, "x", Strong.easeOut, startValue, finishValue, duration, true); myTween.looping = true;
You need to login to post a comment.
