Dynamically drawing shapes from actionscript

Usually, when I have a problem with some special animation or special effect technique for flash, Im usually able to find a tutorial for it.

However…

Lately Ive wanted to do an effect in Flash MX (non-2004 version) which I cannot find a tutorial for. Basically I was wondering if it was possible (and if so… how to) to use actionscript to dynamically draw a shape on the stage for a flash movie.

Now, even if thats possible, here is the trick/twist/catch, the shape that I wish to dynamically create is from the overlap of two shapes.

If you need a visual example, imagine two separate circles (one blue and the other a red color; if one of the circles can be controlled via directional keys and is moved over the other circle, a custom shape conforming to the borders of both shapes with the color purple is formed.

I’ve searched desperately for a tutorial about how to do this. If its not possible, at least my agony of trying to do this will be relieved :shifty: