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

カクカクclosure graphics

Get Adobe Flash player
by dice 29 Jan 2010
/**
 * Copyright dice ( http://wonderfl.net/user/dice )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/9tWe
 */

// forked from clockmaker's closure graphics
// forked from Altschuler's flash on 2010-1-29
package {
    import flash.display.Sprite;
    import flash.display.Bitmap;
    import flash.display.BitmapData;
    import flash.geom.Rectangle;
    import frocessing.color.ColorHSV;
    
    [SWF( backgroundColor=0, frameRate=60 )]
    public class FlashTest extends Sprite {
    		private var bmpd: BitmapData;
    		private var bmp:Bitmap;
    		public function FlashTest() {
    			bmpd = new BitmapData(465, 465 , true, 0xff000000);
    			bmp = new Bitmap(bmpd);
    			addChild(bmp);
			
			//*
			addEventListener("enterFrame",function(n){
				return function() {
					var r=235, nx=235, ny=235, m=Math, h=new ColorHSV();
					bmpd.lock();
					bmpd.fillRect(new Rectangle(0,0,465,465), 0xff000000);
					var glX,glY,tempX,tempY,r2;
					for(var i=0; i<r; i++){
						h.h = i/r * 135 + n * 4000;
						glX = nx + (i * m.cos(i + (i * n)));
						glY = ny + (i * m.sin(i + (i * n)));
						tempX = m.round(glX);
						tempY = m.round(glY);
						r2 = Math.atan2(glY - ny, glX - nx);
						while (m.round(ny) != tempY || m.round(nx) != tempX) {
							nx += m.cos(r2);
							ny += m.sin(r2);
							bmpd.setPixel32(nx, ny, h.value32);
						}
					}
					bmpd.unlock();
					n+=.00025; }}(0));
			//*/
        }
    }
}