I want to achieve painting effect in flash.

There will be a brush attached to cursor and once I click&hold the mouse button while moving it on the canvas it will be painting a predetermined image, as if there is a mask covering an image and as I "delete" the mask, image underneath starts to appear.

Any idea how I can develop such thing ?