Here's an old testclass of mine. It uses those custom easing equations from mx.transitions.easing.*;
import mx.transitions.easing.*; import mx.utils.Delegate; class TweenTest { public static var fps:Number = 31; private var intervalID:Number; private var time:Number; private var obj:Object; private var prop:String; private var func:Function; private var begin:Number; private var finish:Number; private var duration:Number; private var useSeconds:Boolean; public function TweenTest() { _root.play_btn.onRelease = Delegate.create(this, startTween); _root.pauze_btn.onRelease = Delegate.create(this, pauzeTween); _root.stop_btn.onRelease = Delegate.create(this, stopTween); time = 0; obj = _root.mc; prop = "_x"; func = Strong.easeOut; begin = obj[prop]; finish = begin + 200; duration = Math.floor(2000/fps); useSeconds = true; } public function startTween() { clearInterval(intervalID); intervalID = setInterval(this, "calc", Math.floor(1000/fps)); } public function stopTween() { clearInterval(intervalID); time = 0; obj[prop] = begin; } public function pauzeTween() { clearInterval(intervalID); // time is not reset } public function calc() { if (time < duration) { obj[prop] = func.apply(null, [time++, begin, (finish-begin), duration]); } else stopTween(); } } 2006/6/27, Weyert de Boer <[EMAIL PROTECTED]>:
I will try it out :) _______________________________________________ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com
_______________________________________________ Flashcoders@chattyfig.figleaf.com To change your subscription options or search the archive: http://chattyfig.figleaf.com/mailman/listinfo/flashcoders Brought to you by Fig Leaf Software Premier Authorized Adobe Consulting and Training http://www.figleaf.com http://training.figleaf.com