In this thoroughly explained, detailed lesson, I will show you how to draw any shape using a little action script code. This lesson is created on a simple way. You just have to copy and paste my action script code to make a shape. Let's start!
Action Script 2
Step 1
Create a new Flash document. Go to the Action Script Panel (F9). Copy and paste code below to get a blue rectangle.
this.createEmptyMovieClip("rectangle_mc", 1);
with(rectangle_mc){
lineStyle(6, 0x003399, 100, true, "normal", "rectangle", "bevel", 1);
moveTo(0, 0);
lineTo(150, 0);
lineTo(150, 70);
lineTo(0, 70);
lineTo(0, 0);
_x=80;
_y=80;
}

Copy and paste code below to get a red line:
this.createEmptyMovieClip("line_mc", 1);
with(line_mc){
lineStyle(2, 0x990000, 100, true, "normal", "square", "miter", 1);
moveTo(0, 0);
lineTo(150, 0);
_x=180;
_y=165;
}

Action Script 3
Copy and paste code below to get a green square:
var square:Sprite = new Sprite();
addChild(square);
square.graphics.lineStyle(3,0x336600);
square.graphics.beginFill(0x336600);
square.graphics.drawRect(50,100,100,100);
square.graphics.endFill();
square.x = stage.stageWidth/3-square.width/3;
square.y = stage.stageHeight/3-square.height/3;

Copy and paste code below to get a black circle with red border:
var myCircle:Shape = new Shape();
myCircle.graphics.lineStyle(2, 0xff0000);
myCircle.graphics.beginFill(0x000000);
myCircle.graphics.drawCircle(130, 220, 80);
addChild(myCircle);
myCircle.graphics.endFill();

That's it!
Enjoy!