tweener transition plotting
/**
* Copyright wh0 ( http://wonderfl.net/user/wh0 )
* MIT License ( http://www.opensource.org/licenses/mit-license.php )
* Downloaded from: http://wonderfl.net/c/z7U5
*/
package {
import flash.display.Sprite;
import flash.display.StageScaleMode;
[SWF(width=300, height=400, frameRate=60)]
public class TweenStuff extends Sprite {
private static const TRANS:Array = [
[0x000000, 'Linear'],
[0xff0000, 'EaseOutSine'],
[0xff9900, 'EaseOutQuad'],
[0xccff00, 'EaseOutCubic',
[0x33ff00, 'EaseOutQuart']],
[0x00ff66, 'EaseOutQuint'],
[0x00ffff, 'EaseOutExpo'],
[0x0066ff, 'EaseOutCirc'],
[0x3300ff, 'EaseOutElastic'],
[0xcc00ff, 'EaseOutBack'],
[0xff0099, 'EaseOutBounce']
];
public function TweenStuff() {
stage.scaleMode = StageScaleMode.NO_SCALE;
graphics.lineStyle(0, 0, 0.5);
graphics.moveTo(0, 400);
graphics.lineTo(0, 100);
graphics.lineTo(300, 100);
graphics.lineStyle(0, 0, 0.1);
for (var x:int = 0; x <= 60; x++) {
graphics.moveTo(x * 5, 400);
graphics.lineTo(x * 5, 100);
}
for each (var z:Array in TRANS) {
addChild(new Profile(z[0], z[1]));
}
}
}
}
import caurina.transitions.Tweener;
import flash.display.Shape;
internal class Profile extends Shape {
private var _val:Number = 0;
private var time:Number = 0;
public function Profile(c:uint, t:String) {
y = 400;
graphics.lineStyle(0, c);
graphics.moveTo(0, 0);
Tweener.addTween(this, {val: 1, time: 1, transition: t});
}
public function set val(v:Number):void {
_val = v;
graphics.lineTo(++time * 5, -300 * _val);
}
public function get val():Number {
return _val;
}
}