Edit bitmap from AS3
This will be my second post and the second problem ![]()
I create editable Bitmap with this code:
Everything has been very good loaded and I can see the efect in my swf. But the main thing that I want to do is fill the elements with different colors. I added listener to the stage, which has to do it, but it doesn't work:
stage.addEventListener(MouseEvent.CLICK, FillObject); function FillObject(me:MouseEvent):void{ myBitmapaData.floodFill(mouseX,mouseY,0x55cc33); }
I haven't idea what is wrong. I should reload the picture ? If somebody have any idea I will be grateful.
I found the way but it's not enough for me. I load the picture to the library and create the linkage. Than all is ok.
var myBitmapData:kolorowanka1 = new kolorowanka1(839,598); var BMP:Bitmap = new Bitmap(myBitmapData); stage.addChild(BMP); stage.addEventListener(MouseEvent.CLICK, FillObject); function FillObject(me:MouseEvent):void{ myBitmapData.floodFill(mouseX,mouseY,0x55cc33); }
But I want to load pictures from disk.
I attached rar with fla and picture.
http://www.watchtime24.sisco.pl/moje/prace/FLASH/paint.rar
Thans for all replies ![]()
