You can apply a composite mode to the MovieClip that will be your mask.
- Nest the MovieClip you want masked and the MovieClip that will be your mask into a nesting MovieClip, making sure the masking MovieClip is above the masked MovieClip on it's own layer.
- Set the nesting MovieClip to Render mode 'Cache as Bitmap'.
- Inside the nesting MovieClip, animate the mask as you would like and add a name to the mask instance (other than the word 'mask'). For example, you may use the name 'msk'.
- Create a layer above everything inside the nesting MovieClip. Name it something like 'code' and on the very first frame on your code layer, add the following JS code and change compositeOperation to something such as 'destination-out' or 'destination-in'. There are several different operations so google global composite operations to read about them.
if(!this.init) {
this.msk.compositeOperation = "destination-in"; // change the composite mode to your needs.
this.timeline.on('change', () => this.updateCache()); // this updates the cache as the frame changes
this.init = true;
}