Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
Drawing vector graphics programmatically in Flash Player is performed through the Graphics object.
You can't instantiate a Graphics object or put it in the display list. Use the graphics property of a Shape, Sprite, or MovieClip instead.
Graphics objects are state machines.
Basic path operations include moving the "pen," drawing a straight-line segment, and drawing a curve.
To stroke a path, you must first set a line style with lineStyle().
Line styles can be followed by stroke fill styles for non-solid-color fills.
To fill a path, use begin[kindof]Fill() methods and endFill().
Clear the canvas by calling clear().
Strokes and fills may be styled with solid colors, gradients, bitmap fills, and shader fills (varies by Flash Player version).
Draw primitives with methods like drawRect() and drawCircle().
Paths can be stored as lists of command types and coordinates and drawn with drawPath() (varies by Flash Player version).
Paths, fills, and strokes can be encapsulated in drawing command objects that implement IGraphicsData and drawn with drawGraphicsData() (varies by Flash Player version).
Mapping textures to polygons is possible with drawTriangles() (varies by Flash Player version).