forked from: forked from: flash on 2009-10-19
forked from forked from: flash on 2009-10-19 (diff: 6)
ActionScript3 source code
/**
* Copyright takabo1212 ( http://wonderfl.net/user/takabo1212 )
* MIT License ( http://www.opensource.org/licenses/mit-license.php )
* Downloaded from: http://wonderfl.net/c/dJ7f
*/
// forked from takabo1212's forked from: flash on 2009-10-19
// forked from yaneura9's flash on 2009-10-19
package{
import flash.display.Sprite;
import flash.events.MouseEvent;
import caurina.transitions.Tweener;
public class Anime2 extends Sprite{
public function Anime2():void{
// クリックイベントを監視する
stage.addEventListener("mouseMove", clickHandler);
}
private function clickHandler(event:MouseEvent):void {
// 円を作成
var s:Sprite = new Sprite();
s.graphics.beginFill(Math.random() * 0x1000000);
s.graphics.drawCircle(0, 0, 10);
s.graphics.endFill();
s.alpha = 0.8;
addChild(s);
// 円をクリックされた位置に移動
s.x = event.stageX;
s.y = event.stageY;
s.scaleX = s.scaleY = 0;
Tweener.addTween(s, {
time: 1, // 1秒間のアニメーション
scaleX: 0.5, // s の scaleX を 5 まで遷移
scaleY: 5 // s の scaleY を 5 まで遷移
});
Tweener.addTween(s, {
time: 3,
alpha: 0
});
}
}
}