I want to set the color of setPixel in bitmapData dynamicaly. What I mean is that I find a value for red, green and blue, convert to hex and then use setPixel(x,y,c); to draw. The problem is that if I try
Code:
r=255;
g=0;
b=20;
var c:String = "0x"+r.toString(16)+g.toString(16)+b.toString(16);
myBitmapData.setPixel(x, y, c);
I get the following error:
**Error** Scene=Scene 1, layer=Layer 1, frame=1:Line 143: Type mismatch.
myBitmapData.setPixel(x, y, c);

I have tried with the color object but I can't get it to work.