Adobe Flash CS6 makes some of its authoring functionality programmable via a Javascript API called JSFL. It's not especially fun to work with, as it lacks a debugger or any other tooling, but being able to create custom drawing tools was irresistable. Hence:
The API I spent the most time scratching my head over was fl.drawingLayer, which is used for rendering the temporary outlines that appear when (for example) you're dragging out a box with the Rectangle tool. It has some quirks.
fl.drawingLayer.beginFrame
clears this array.
fl.drawingLayer.endFrame
draws the contents of this array to the screen.
fl.drawingLayer.beginDraw
, according to its documentation, "puts Flash in drawing mode", and sets the Boolean persistentDraw
option, which will cause flash to leave your drawing on the stage after the mouse button is released. In practice it seems to make no difference.