Click and drag draw a rectangle

Hi guys/gals:

I have used the drawing API actionscript for years now. However, I would really like to use it to create a button that enables the user to click, drag, and unclick to create a rectangle. Kind of like a highlighting tool on a document…

Think, Adobe Illustrator rectangle tool.

Is there a way to code a button to turn this function on? Can somebody point me in the right direction please?

I’ve looked through several scrips and it seems like the lineto and fill scripts don’t exactly let you drag and size the rectangle dynamically.

Any help is much appreciated. Thanks!!!

Greg