# Gradient Mask on 1 level deep

**URL:** https://forum.kirupa.com/t/gradient-mask-on-1-level-deep/251829
**Category:** flash
**Created:** [February 13, 2008, 1:23am UTC](https://forum.kirupa.com/t/gradient-mask-on-1-level-deep/251829 "2008-02-13T01:23:40Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![ageshi](https://avatars.discourse-cdn.com/v4/letter/a/7ba0ec/32.png) [@ageshi](https://forum.kirupa.com/u/ageshi)
#### Post date: [February 13, 2008, 1:23am UTC](https://forum.kirupa.com/t/gradient-mask-on-1-level-deep/251829/1 "2008-02-13T01:23:40Z")

</div>

Hey everyone,

I have the gradient mask working in Flash 8 using the following AS:

clip.cacheAsBitmap = true;  
mask.cacheAsBitmap = true;  
clip.setMask(“mask”);

However, this code does not work when I put it inside a movie clip. It only works if it is in the root (scene 1). I have tried giving my Movie clip an instance name of test and doing the following and it still doesn’t work:

\_root.test.clip.cacheAsBitmap = true;  
mask.cacheAsBitmap = true;  
\_root.test.clip.setMask(“mask”);

\*The instance name “test” would be the movie clip where I have the mask and the clip to be masked placed.

Any ideas how I can resolve this?

Thanks you!!!
