Is the gradient mask Flash CS6 not working? The solution…

This article was written by in June 24, 2014, & may not be posted on other sites!
Original source url for this article: Is the gradient mask Flash CS6 not working? The solution…

Gradient mask flash CS6 not working?
In earlier Flash versions you could just create a shape and fill it with a gradient color, using 0% – 100% color fill to create a gradient mask,  But what about Flash CS6? Is the gradient mask in Flash CS6 not working? We tried out all kinds of solutions on the web and nothing is working in Flash CS6! But we have a solution! This is how to create a gradient mask in Flash CS6:

Is the gradient mask Flash CS6 not working problems? tutorial on gradient mask

 

Gradient mask Flash CS6 not working?

The problem: When trying to create a shape using 0% – 100% color fill (and put it in a movieclip) it’s not working as a gradient mask. When using the blur filter on your mask it still won’t work.  It will mask out the whole shape and ignore the gradient / blur. The gradient mask is not working in Flash CS6!

 

The Solution – the gradient mask in Flash CS6

You can’t create a gradient mask in Flash CS6 without using AS3. But this is done easily. Just follow these simple steps to create a gradient mask in Flash CS6:

  1. Open Flash CS6 and create a new AS3 document.
  2. Create a layer and put an objekt on the stage, for example an image. Make sure the image is inside a movieclip. To create a new movieclip, go to insert > new symbol.
  3. Create your mask shape and put it in another movieclip. Open the color panel and fill your vector shape with a linear or radial gradient using an alpha 0% – 100% color fill. 100% color will show the element and 0% will hide the element. Put the shape movieclip on the stage in a second layer just above the image.
    Is the gradient mask Flash CS6 not working?
  4. Select your shape mask on the stage and give it an instance name in the Properties panel, for example theMask.
    Is the gradient mask Flash CS6 not working? tutorial on gradient mask
  5. Select your image and give it an instance name, for example theObject.
  6. Create a third layer above the image and the mask and open the actionscript 3 panel, Window > actions or press F9. Write this code in the actions panel:
    theMask.cacheAsBitmap = true;
    theObject.cacheAsBitmap = true;
    theObject.mask = theMask;

    Basically we are telling flash to treat the image and the mask as bitmaps, and to use the shape layer as a mask on the image.
    Is the gradient mask Flash CS6 not working? tutorial on gradient mask
  7. Your layers will still look exactly the same in the stage, but when publishing your SWF the gradient mask will work as expected! Just press ctrl + enter to publish your flash file and you can see that your gradient mask is working!
    Is the gradient mask Flash CS6 not working? tutorial on gradient mask

 

Spread the word

Facebooktwittergoogle_pluslinkedinmail

Leave a Reply

Your email address will not be published. Required fields are marked *