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

tweensy入門(gihyoより)

Get Adobe Flash player
by tayapon 12 Jun 2012
    Embed
/**
 * Copyright tayapon ( http://wonderfl.net/user/tayapon )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/lVXs
 */

 // 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()*0x100000);
             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:5,
                 scaleY:5
             },1);
         }
     }
 }