Masking in flash CS4

hi id like to be able to use gradient masks in cs4.
Something like boxes to reveal a layer.

Im currently using:
maskee.cacheAsBitmap = true;
maskMC.cacheAsBitmap = true;
maskee.setMask(“maskMC”);

which works, but when I place that swf in a container it stops working.