Chapter 19. Drawing Vectors in Code

Draw Lines in Code

ActionScript provides a full programming interface that allows you to draw objects onscreen through code, freeing you from having to rely on the Flash Professional drawing tools. This interface is particularly helpful in that you can have objects drawn at runtime based on user-provided variables.

Drawing in ActionScript relies on the Graphics class, which defines line and fill styles and lets you draw lines, curves, and shapes. All the methods of the class can be called via the graphics property of the display object onto which you are drawing. It can be helpful, although not required, to create a specific object, often using the Sprite class, to hold your drawings rather than place them directly ...

Get ActionScript®: Your visual blueprint™ for creating interactive projects in Flash® CS4 Professional now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.