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: closure graphics

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

// forked from clockmaker's closure graphics
// forked from Altschuler's flash on 2010-1-29
package {
    import flash.display.Sprite;
    import frocessing.color.ColorHSV;
    import flash.display.Bitmap;
    import flash.display.BitmapData;
	import flash.filters.BlurFilter;
	import flash.geom.Point;	
	import flash.display.BlendMode; 
	import flash.display.*;   
    
    [SWF( backgroundColor=0, frameRate=120 )]
    
    public class FlashTest extends Sprite {
		public var blur1:BlurFilter = new BlurFilter(10, 10, 1);
		public var traceMap:Bitmap;
		public var mapData:BitmapData;
		private var capPoint:Point = new Point(0, 0);
		public var capObj:Sprite = new Sprite();
		public var overlay:Sprite = new Sprite();
		    	
        public function FlashTest() {
            // one line
   			var sw:Number = this.stage.stageWidth;
			var sh:Number = this.stage.stageHeight;

			mapData = new BitmapData(sw, sh, true, 0x000000);
			traceMap = new Bitmap(mapData);
			var rect = traceMap.getRect(this);
			
			overlay.graphics.beginFill(0x000000, 0.05);
			overlay.graphics.drawRect(0,0,sw,sh);
			
			this.addChild(traceMap);
			this.addChild(capObj);
			capObj.addChild(overlay);
            
            addEventListener("enterFrame",function(n){
                return function() {
                    var r=235, m=Math, h=new ColorHSV();
                    with(capObj.graphics) {
                        clear();
                        moveTo(r, r);
                        for(var i=0; i<r; i++){
                            h.h = i/r * 135 + n * 4000;
                            lineStyle(1, h.value32, 1 - i/r);
                            lineTo(
                                r + (i * m.cos(i + (i * n))),
                                r + (i * m.sin(i + (i * n))));
                        }
                    }
					mapData.draw(capObj, null, null, BlendMode.NORMAL, null, false);
					mapData.applyFilter(mapData, rect, capPoint, blur1 );
                    n+=.003; }}(0));
        }
    }
}