Gradient Mask in Flash Actionscript 3.0

Creating a gradient mask in Flash Actionscript 3.0 is actually pretty easy.

1) Create your masking graphic and apply a gradient fill (I’m assuming you know how to make this masking graphic – if not, you probably need a different tutorial first)

2) Add this line to your main timeline:

cliptomask.mask = maskinggraphic;

Where cliptomask is the instance name of the movie clip you are masking and maskinggraphic is the instance name of the masking graphic.
3) Add these two lines directly underneath
cliptomask.cacheAsBitmap = true;
maskinggraphic.cacheAsBitmap = true;
And that’s it! Let me know if you run into any issues…

One Response to “Gradient Mask in Flash Actionscript 3.0”

  1. rajguru Says:

    Wow , Its so simple , I never tried it .

    Thanks

Leave a Reply

This entry was posted on Thursday, July 16th, 2009 at 11:04 pm and is filed under Flash Design & Development. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.