In case Flash no longer exists; a copy of this site is included in the Flashpoint archive's "ultimate" collection.

Dead Code Preservation :: Archived AS3 works from wonderfl.net

forked from: tweensy demo

tweensy version of this
http://gihyo.jp/dev/feature/01/flash-sdk/0006
Get Adobe Flash player
by vnd 08 Dec 2009
    Embed
// forked from mash's tweensy demo
// tweensy version of this
// http://gihyo.jp/dev/feature/01/flash-sdk/0006
package{
    import flash.display.Sprite;
    import flash.events.MouseEvent;
    import com.flashdynamix.motion.Tweensy;

    public class Anime2 extends Sprite{
        public function Anime2():void{
            // クリックイベントを監視する
            stage.addEventListener("click", 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();
            addChild(s);

            // 円をクリックされた位置に移動
            s.x = event.stageX;
            s.y = event.stageY;
            s.scaleX = s.scaleY = 0;

            Tweensy.to(s, {
                scaleX: 20,  // s の scaleX を 5 まで遷移
                scaleY: 20   // s の scaleY を 5 まで遷移
            }, 4 ); // 第3引数がduration
        }
    }
}