# Sprite Gradient Mask AS3

**URL:** <https://forum.kirupa.com/t/sprite-gradient-mask-as3/313832>\
**Category:** flash\
**Created:** [September 10, 2010, 9:36pm UTC](https://forum.kirupa.com/t/sprite-gradient-mask-as3/313832 "2010-09-10T21:36:24Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![VeddyCent](https://avatars.discourse-cdn.com/v4/letter/v/bc8723/32.png) [@VeddyCent](https://forum.kirupa.com/u/VeddyCent)\
**Post date:** [September 10, 2010, 9:36pm UTC](https://forum.kirupa.com/t/sprite-gradient-mask-as3/313832/1 "2010-09-10T21:36:24Z")

</div>

Hi all,

This is my first post so forgive me if I make any mistakes.

I have created a Sprite that contains 3 movieclips that act as masks for another movieclip. 2 of the moviclips have an alpha gradient but I cannot get the alpha to work. I have the three masks because they are separately animated.

Here is my code.

var maskContainer = new Sprite();

maskContainer.addChild(WebPageMaskEndT\_mc);  
maskContainer.addChild(WebPageMaskEndB\_mc);  
maskContainer.addChild(WebPageMask\_mc);

BackgroundImage\_mc.cacheAsBitmap = true;  
maskContainer.cacheAsBitmap = true;

BackgroundImage\_mc.mask = maskContainer;

[COLOR=“Red”]NOTE[/COLOR]: I have also tried setting cacheAsBitmap for the 3 individual masks but no results.

Any help would be much appreciated  
Thanks
