views:

295

answers:

1

Hi all

What I am trying to achieve might be trivial, however I am loading a PNG mask which does not have a transparent background, but rather a black background, with the shape defined on top in white (the actual mask which needs to be applied). Apparently Flex expects me to provide a mask with a transparent background for it to work, or am I missing something?

If that's the case, could I transform the bitmapData which I am loading so that it treats black color as transparent?

thanks in advance.

A: 

One way is to BitmapData's CopyChannel This works best if you are trying to apply one bitmap as the alpha layer of another bitmap.

Set the source to your alpha bitmap and the source channel to R,G or B, and destination channel to Alpha

example of use is in the link

Daniel
Thank you, that's really helpful!
airlocker