I run through a few loops to build out a 32 x 32 block
In my real example the colors vary but in testing, even simplified I am getting nowhere
var tempWidth:int = currentTileSel.width;
var tempHeight:int = currentTileSel.height;
var newbit:Bitmap = null;
var myBitmapData:BitmapData = new BitmapData(tempWidth, tempHeight,true,0x000000);
var drawCount:int = 0;
for(var i:int = 0; i< tempHeight; i++)
{
for(var j:int = 0; j < tempWidth; j++)
{
var setColor:uint = pixelArray[drawCount].colorfill;
myBitmapData.setPixel32(j,i,0x000000);
drawCount++;
}
}
///*
currentTileSel.graphics.clear();
currentTileSel.graphics.lineStyle(.25,0xCCCCCC,.5,false);
currentTileSel.graphics.beginBitmapFill(myBitmapData);
currentTileSel.graphics.drawRect(0,0,tempWidth,tempHeight);
currentTileSel.graphics.endFill();
currentTileSel.bitmapHolder = myBitmapData;
//*/
newbit = new Bitmap(myBitmapData);
gridLoader.addChild(newbit);
I would think this would produce a black bitmap pixel by pixel, but I get nothing on the bitmapFill and nothing when I add it to the screen as a bitmap.
What am I doing wrong? Thanks a lot in advance!
Your problem is this line:
Here, you are setting the transparency to 0.
Try: