flash on 2010-9-27

by ushisantoasobu
♥0 | Line 33 | Modified 2010-09-27 19:14:48 | MIT License
play

ActionScript3 source code

/**
 * Copyright ushisantoasobu ( http://wonderfl.net/user/ushisantoasobu )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/w8yM
 */

package {
    import flash.display.Sprite;
    import flash.events.MouseEvent;
    import flash.events.Event;
    import caurina.transitions.Tweener;
    
    [SWF(width=400, height=400, frameRate=30, backgroundColor=0xffffff)]    
    
    public class FlashTest extends Sprite {
        public function FlashTest() {
            // write as3 code here..
            this.addEventListener(MouseEvent.MOUSE_MOVE, MOUSEMOVEhandler);            
        }
        
        private function MOUSEMOVEhandler(e:MouseEvent):void{
            
            var ball:Sprite = new Sprite();
            ball.graphics.beginFill(0x000000);
            ball.graphics.drawCircle(0,0,100);
            ball.graphics.endFill();
            
            ball.x = mouseX;
            ball.y = mouseY;
            
            //ball.addEventListener(Event.ADDED, aaa);
            
            this.addChild(ball);
            
           }
        
        private function aaa(e:Event):void{
            
            Tweener.addTween(e.target, {
                time:3,
                alpha:0,
                transition:"easeInCubic",
                onComplete:bbb,
                onCompleteParams:[e.target]
                });
        }
       
       private function bbb(ball:Sprite):void{
           removeChild(ball);
       }



    }
}