Introduction to Flash and Actionscript

Graphics Commands

 

Basic drawing commands

ActionScript 3 has always provided the ability to draw lines and curves using the Graphics class. The primary commands of the Graphics class allow you to define a line style, move the line through a series of points, and then fill the shape.

The basic graphics methods for drawing vectors are:

lineStyle() - Specificies the look of any line stroke we make.
moveTo() - Moves the drawing pointer to the specific point.
lineTo() - Draws a line to the specified point.
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.

 

Drawing a Line


Drawing a Square

 


Drawing a Curve

 

Filling Shapes

To fill any shape we just need to add 2 lines.
One to start the fill and one to end the fill

Other Shapes

 

Assignment 1:

 

Pattern Fills

Import your Pattern to the Library File > Import > Import to Library

Set the image to be useable in Actionscript

 

 

Assignment 2: House