Adobe flash actionscript as3 mask movieclips with gradient alpha masks

With actionscript as3  you can ad a mask to a display object ie. movieclip with simple line of code.

mc_to_be_masked.mask = masking_mc;

But this will usually ignore any alpha gradients you might have in your masking movie clip.

To make the masking work  properly, you have to set everything to be caches as bitmaps. Both mask and movieclip that is going to be masked.

mc_to_be_masked.cacheAsBitmap = true;
masking_mc.cacheAsBitmap = true;
mc_to_be_masked.mask = masking_mc;

Tadaa, masks alpha properties should work as expected.

Leave a Reply