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

perlin noise xor

Get Adobe Flash player
by codeonwort 31 May 2012
/**
 * Copyright codeonwort ( http://wonderfl.net/user/codeonwort )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/ymjg
 */

package {
    import flash.display.Bitmap;
    import flash.display.BitmapData;
    import flash.display.Sprite;
    public class FlashTest extends Sprite {
        public function FlashTest() {
            // write as3 code here..
            var bd:BitmapData = new BitmapData(465, 465, false)
            bd.perlinNoise(465/2, 465/2, 3, Math.random() * 123, true, true)
            
            var bd2:BitmapData = new BitmapData(465, 465, false)
            bd2.perlinNoise(465/2, 465/2, 3, Math.random() * 123, true, true)
            
            var c:uint
            for(var i:int=0; i<bd.width; i++){
                for(var j:int=0; j<bd.height; j++){
                    c = bd.getPixel(i, j) ^ bd2.getPixel(i, j)
                    bd.setPixel(i, j, c)
                }
            }
            
            addChild(new Bitmap(bd))
        }
    }
}