// forked from mrdoob's Flaxor // // Flaxor (989bytes effect) // by Mr.doob // // Thanks to Texel (http://www.romancortes.com/) and Forrest Briggs (http://laserpirate.com/flashblog/) // package { import flash.display.Bitmap; import flash.display.BitmapData; import flash.display.Sprite; import flash.events.Event; [SWF(width="465",height="465",backgroundColor = "#000000", frameRate = "50")] public class Main extends Sprite { public var canvas : BitmapData; public var sw : int = 465, sh : int = 465, timer:int = 0; public function Main() { stage.scaleMode = "noScale"; stage.align = "TL"; stage.addEventListener("resize", init); init(); addEventListener("enterFrame", loop); } public function init() : void { canvas = new BitmapData(sw, sh, false); addChild( new Bitmap(canvas) ); } public function loop(e:Event):void { canvas.lock(); for (var xx:int = 0; xx < sw; xx++) for (var yy:int = 0; yy < sh; yy++) canvas.setPixel(xx, yy, (xx + timer | yy + timer) * timer); canvas.unlock(); timer++; } } } forked from: Flaxor