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

Random x Bitmap

Some random tests with pixel param of setPixel on BitmapData
Get Adobe Flash player
by ne_ 29 Jan 2012
    Embed
/**
 * Copyright ne_ ( http://wonderfl.net/user/ne_ )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/mEEz
 */

package {
    import flash.display.Bitmap;
    import flash.display.BitmapData;
    import flash.display.Sprite;
    public class FlashTest extends Sprite {
        private var bDat:BitmapData = new BitmapData(100,100,false,0x000000);
        private var bmp:Bitmap = new Bitmap(bDat);
        public function FlashTest() {
            // write as3 code here.
            addChild(bmp);
            bmp.scaleX = bmp.scaleY = 3;
            main();
        }
        public function main():void{
            for(var i:int = new int();i<100;i++){
                for(var a:int = new int();a<100;a++){
                    //bDat.setPixel(i,a, i*a*255);
                    //bDat.setPixel(i,a, i*255+a*255);
                    //bDat.setPixel(i,a, (i*i)+a*255);
                    //bDat.setPixel(i,a, a*i*256);
                    //bDat.setPixel(i,a, i*a);
                    //bDat.setPixel(i,a, (i+255)*255+a*155);
                    //bDat.setPixel(i,a, Math.pow(i^a, 2));
                    //bDat.setPixel(i,a, Math.pow(i*a, 2)^255);
                    //bDat.setPixel(i,a, Math.pow(i^(a^255), 2)^255);
                    //bDat.setPixel(i,a,Math.sin(i)*256);
                    bDat.setPixel(i,a,Math.cos(i*a)*256);
                    //bDat.setPixel(i,a,Math.sqrt(i*a));
                    //bDat.setPixel(i,a,uint("0x"+i.toString(2))*a);
                }
            }
            
        }
    }
}