KTween
English 日本語
- An yet another lightweight tween engine for ActionScript 3.0.
- The best choice for developing mobile contents targeting smart phones.
SYNOPSIS
import net.kawa.tween.KTween;
import net.kawa.tween.KTJob;
import net.kawa.tween.easing.*;
public function run():void {
KTween.to(mySprite, 2, {alpha: 0.0}, Linear.easeOut, callback);
KTween.from(mySprite, 3, {x:320, y;480}, Quad.easeOut).round = true;
var job:KTJob = KTween.fromTo(mySprite, 4, {x:0, y:0}, {x:320, y;480}, Elastic.easeOut);
job.repeat = true;
}FEATURE
- Free under the MIT license. Original. written from scratch.
- ActionScript 3.0. Flash 9/10 and later.
- Simple. Shorter source code. Less file bytes.
- Much faster than Tweener and GTween. Bit faster than TweenNano and BetweenAS3.
- AS3 type declaration checking available for the options of KTween
DOCUMENTS
SOURCE
DOWNLOAD
svn co http://kawanet.googlecode.com/svn/lang/as3/KTween/trunk/src/ KTween
EASING TRANSITIONS
- Linear.easeOut - t
- Circ.easeOut - Math.sqrt(t)
- Quad.easeOut - t * t
- Cubic.easeOut - t ** 3
- Quart.easeOut - t ** 4
- Quint.easeOut - t ** 5
- Expo.easeOut - 2 ** (10*t) -- since v.1.0.2
- Sine.easeOut - Math.sin
- Back.easeOut
- Bounce.easeOut
- Elastic.easeOut
- easeIn and easeInOut are also exists. See: see this demo.
- These functions require one argument (not four) each.
CALLBACK FUNCTIONS
- onInit - invoked at the tween started.
- onChange - invoked at every ticks.
- onComplete - invoked at the last tick.
- onClose - invoked at the tween finished.
- onCancel - invoked at the tween canceled.
- Use onCloseParams etc. to give arguments for the callbacks.
EVENTS
- Event.INIT - dispatched at the tween started.
- Event.CHANGE - dispatched at every ticks.
- Event.COMPLETE - dispatched at the last tick.
- Event.CLOSE - dispatched at tween finished.
- Event.CANCEL - dispatched at tween canceled.
- Call addEventListener to catch these event.
- e.target.target is the target object of the tween job.