Drawing simple geometry with AS 3

API drawing

Vectors in AS3 are created by using the Graphics Class. Unlike the majority of other classes, there is no need to create an instance of this class before you use it because an instance of it is already instantiated as a property of any display objects that is a Shape, Sprite, and MovieClip.
You can draw simple geometric objects like lines, circles, triangles or squares defining every property, complex drawings defining lines and create more complex effect with a Matrix.

Typical process:

circle.graphics.beginFill (0xFF66FF, 0.8) ;

circle .
graphics
. beginFill (0xFF66FF , 0,8) ;
instance .
class
. method name hex color , alpha (0 to 1) ;

circle.graphics.drawCircle(0,2,20) ;

circle .
graphics
. beginFill (0 , 2 , 20 ) ;
instance .
class
. method name center: x value , center: y value , radius value ;


Circle.graphics.endFill();

circle .
graphics
. endFill ( ) ;
instance .
class
. method name () ;

addChild (circle);

The basic graphics methods for drawing vectors are:

lineStyle() - Specificies the look of any line stroke we make.
lineStyle (thickness =n, color =n, alpha =0.8, pixelHinting ="false", scaleMode = "normal", caps ="none", joints ="bevel" , miterLimit = 3)

moveTo() - Moves the drawing pointer to the specific point.
moveTo ( x = n, y =n )

lineTo() - Draws a line to the specified point.
lineTo ( x = n, y =n )

curveTo() - Draws a curve to the specific point.

beingFill() - Starts color filling the area between the lines.

endFill() - Ends of the fill of the area between the lines.

clear() - Clears all vectors inside a graphics object.

Tutorials

Advanced beginBitmapFil :
http://www.reflektions.com/miniml/template_permalink.asp?id=328

http://www.reflektions.com/miniml/template_permalink.asp?id=327

Using a matrix:
http://www.kirupa.com/forum/showthread.php?288157-Problems-with-beginBitmapFill