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: お試し

Get Adobe Flash player
by tan_go238 02 Jan 2009
    Embed
// forked from kimu's お試し
package {
    import flash.display.Sprite;
    import flash.events.Event;
    import flash.display.BlendMode;
    import flash.filters.BlurFilter;
    import flash.display.Bitmap;
    import flash.display.BitmapData;
    import flash.geom.Matrix;
    import flash.geom.ColorTransform;

    [SWF(width=465,height=465,backgroundColor=0x000000,frameRate=30)]
    public class GraphicTest extends Sprite {
        
        private var grahpicSprite:Sprite;
        private var blurBitmap:Bitmap;
        private var blurBitmapData:BitmapData;
        private var lastMouseX:Number;
	private var lastMouseY:Number;
	private var blendModes:Array;
        
        public function GraphicTest() {
	    //blendModes = [BlendMode.ADD,BlendMode.MULTIPLY,BlendMode.OVERLAY];
            blendModes = [BlendMode.ADD, BlendMode.MULTIPLY, BlendMode.OVERLAY];
            blurBitmapData = new BitmapData(stage.stageWidth,stage.stageHeight,true,0);
            blurBitmap = new Bitmap(blurBitmapData);
            blurBitmap.y = -2;
	    blurBitmap.filters = [new BlurFilter(10,10,3)];
            addChild(blurBitmap);
            grahpicSprite = new Sprite();
            addChild(grahpicSprite);
            addEventListener(Event.ENTER_FRAME,drawLine);
        }

        public function drawLine(e:Event):void {
	    blurBitmapData.draw(this,null,null,blendModes[Math.floor(Math.random()*(blendModes.length-1))]);
            grahpicSprite.graphics.clear();
	    if ( lastMouseX == mouseX && lastMouseY == mouseY ) return;
            grahpicSprite.graphics.beginFill(Math.random()*255*Math.random()*255*Math.random()*255);
            grahpicSprite.graphics.drawCircle(mouseX,mouseY,10);
            grahpicSprite.graphics.endFill();
	    lastMouseX = mouseX;
            lastMouseY = mouseY;
        }
    }
}