forked from: Tweenerによるベジェ曲線のトゥイーン
Tweener 1.31.74
// forked from dkgkAs's Tweenerによるベジェ曲線のトゥイーン
package
{
import flash.display.Sprite;
//Tweener 1.31.74
import caurina.transitions.Tweener;
import caurina.transitions.properties.CurveModifiers;
[SWF(width = 400, height = 400, frameRate = 30, backgroundColor = 0xFFFFFF)]
public class Main extends Sprite
{
private var ball:Sprite;
public function Main():void
{
CurveModifiers.init();
ball = new Sprite();
ball.graphics.beginFill(0x000000);
ball.graphics.drawCircle(0, 0, 5);
ball.graphics.endFill();
addChild(ball);
loopTween();
}
private function loopTween():void
{
if (ball.x == 0)
{
Tweener.addTween(ball, { x:400, y:400, _bezier:[ { x:400, y:0 }, { x:0, y:400 } ], time:5, onComplete:loopTween } );
}
if (ball.x == 400)
{
Tweener.addTween(ball, { x:0, y:0, _bezier:[ { x:0, y:400 }, { x:400, y:0 } ], time:5, onComplete:loopTween } );
}
}
}
}