Gradient Masks in Flash
October 23rd, 2007 . by polyGeekTo create a gradient mask in Flash apply bitmap caching to each of the mask and maskee MovieClips and then use setMask() to apply the mask. As such:maskMC.cacheAsBitmap = true;
img.cacheAsBitmap = true;
img.setMask( maskMC );
Here’s an example:
WhatDoIKnow.org has a nice writeup with comments on the topic. By the way, you can do this same effect without code but it seems like a lot more work to me.
I only need to do this about once a year and I always end up spending an hour going, “how the frak did I do that last year.” Now next year when I need to do this again I can just search my own blog. If I remember that I wrote about this. :-)












Nice one, Dan :-)
very easy to create a gradient alpha mask using code. But sometimes you have to do it the gold old fashioned …
Leave a Reply