flash on 2010-3-2

by drpt
♥0 | Line 25 | Modified 2010-03-02 22:06:41 | MIT License
play

ActionScript3 source code

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

package { 
    import flash.display.Sprite; 
    import flash.events.Event; 
    import flash.filters.BlurFilter
     
 	[SWF(width="400", height="400", frameRate="24", backgroundColor="#000000")]
    
    import flash.events.MouseEvent;
    public class FlashTest extends Sprite { 

        private var ball:Sprite = new Sprite(); 
        private var blur:BlurFilter = new BlurFilter(10,10); 
        
        public function FlashTest() { 
            // write as3 code here..
       		init();            
			this.addEventListener(Event.ENTER_FRAME, move); 
        } 
        
        public function init():void{
			ball.graphics.beginFill(Math.random()*0xFF00FF);                
			ball.graphics.drawCircle(Math.random()*80,Math.random()*70,Math.random()*100);
			filters = [blur]; 
            	addChild(ball); 
        	}
                
        public function move(event:Event):void {
			ball.x = (stage.stageWidth/2 - ball.width/2) + Math.random()*40;
        		ball.y = (stage.stageHeight/2 - ball.height/2) + Math.random()*40;
        		   
        } 
    } 
}