Tweenerを使おう2
/**
* Copyright umhr ( http://wonderfl.net/user/umhr )
* MIT License ( http://www.opensource.org/licenses/mit-license.php )
* Downloaded from: http://wonderfl.net/c/laQB
*/
package{
import caurina.transitions.Tweener;
import flash.display.Sprite;
import flash.events.MouseEvent;
public class Main extends Sprite{
private var _maru1:Sprite;
public function Main(){
_maru1 = new Sprite();
_maru1.graphics.beginFill(0x006666,0.7);
_maru1.graphics.drawCircle(0,0,26);
_maru1.graphics.endFill();
this.addChild(_maru1);
//Tweener.addTween(_maru1, { x:200, y:200, time:3, transition:"easeOutBack" } );
stage.addEventListener(MouseEvent.CLICK,onClick);
}
private function onClick(event:MouseEvent):void{
var dx:Number = Math.random()*stage.stageWidth;
var dy:Number = Math.random()*stage.stageHeight;
Tweener.addTween(_maru1, { x:dx, y:dy, time:3, transition:"easeOutBack" } );
}
}
}