You should be able to make the squares in a smilar way without the overhead of thousands of display objects via fillRect: import flash.display.Bitmap; import flash.display.BitmapData; import flash.geom.Rectangle; //A white 400x400 pixel canvas var myBitmapData:BitmapData = new BitmapData(400, 400, false, 0xFFFFFF); var bm:Bitmap = new Bitmap(myBitmapData); addChild(bm); var sc:uint=0x000000; //coordinate object var o:Object=new Object(); o.x=100; o.y=100; o.w=30; o.h=50; //fill a rect myBitmapData.fillRect(new Rectangle(o.x, o.y, o.w, o.h), sc); o.x=150; o.y=200; o.w=20; o.h=20; //another fill myBitmapData.fillRect(new Rectangle(o.x, o.y, o.w, o.h), sc); There's also getPixel, which returns the color of a pixel at any x, y, so maybe you could randomly check a pixel and if it's white, check to the left and right and up and down until you hit black, which would give you a rectangle of white to add a randomly sized black fill.
... View more