Masking with the drawing API

I want to know if there was a way to create a mask using the drawing API and how would the flash player know what layer to mask.

PS. I love this site more than my own mother!