Convert a drawing to actionscript

Hello great people of kirupa :beer:

as for my first post, i was wondering if there is a way where you make a drawing in Flash CS3 ide and say, select that drawing and convert it to actionscript?

for example: i made a rectangle at the stage and then get flash to generate the code for it like a some sort of “copy object as actionscript”

var s:Sprite = new Sprite();
s.graphics.beginFill(0);
s.graphics.drawRect(0,0,100,100);

i hope you get the idea.