1

I have this situation:

there is some generic movieclip with some color in background (can be green, red, etc), and I load one image and attach in this movieclip as a child, using the same dimensions of the movieclip.

But if this image has some transparency I can see the background ( green, red, etc).

I try this:

loader.contentLoaderInfo.addEventListener(Event.COMPLETE, function(e:Event){
var tempImage:Bitmap = new Bitmap(e.target.content.bitmapData);
image.bitmapData = tempImage.bitmapData;

obj.graphics.beginFill(0xFFFFFF, 0);
obj.graphics.drawRect(0,0,obj.width, obj.height);
obj.graphics.endFill();

obj.addChild(image);
});

But it is not working. And I cant change the obj.alpha because I cant see the image in this case. There is another way?

Thanks

4

1 に答える 1

1

代わりに Bitmapfill を試しましたか?

loader.contentLoaderInfo.addEventListener(Event.COMPLETE, function(e:Event){

    obj.graphics.beginBitmapFill(e.target.content.bitmapData);
    obj.graphics.endFill();
});
于 2012-11-21T20:18:25.493 に答える