Gradient masks inside movieclips?

why doesn’t it work? It works fine on the main timeline with the code below, but not inside a movieclip. Is there a workaround?

mask_mc.cacheAsBitmap = true;
image_mc.cacheAsBitmap = true;
image_mc.setMask(“mask_mc”);