flash on 2010-2-2

by deform
♥0 | Line 30 | Modified 2010-02-04 17:07:26 | MIT License
play

ActionScript3 source code

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

package {
	import flash.filters.DisplacementMapFilter;
	import flash.geom.Point;
	import flash.display.BitmapData;
	import flash.display.Bitmap;
    import flash.display.Sprite;
    
    public class FlashTest extends Sprite {
    	
    	private static const WIDTH:Number = 465;
    	private static const HEIGHT:Number = 465;
    	private static const RANDOMCNT:Number = Math.random()*30;
    	
    	private var bitmap:Bitmap;
    	private var bmd:BitmapData;
    private var shape:Sprite;
    	
        public function FlashTest() {
            // write as3 code here..
            setup();
        }
        
        private function setup():void
        {
        		drawShape(140);
        }
        
        private function drawShape(Size:uint):void
        {
        		shape = new Sprite();
        		shape.graphics.beginFill(0xff00ff);
	        shape.graphics.drawRect((WIDTH/2)-Size/2,(HEIGHT/2)-Size/2,Size,Size);
	        	shape.graphics.endFill();
	        	addChild(shape);
        }
    }
}