Scripting graphics in Flash

Use Flash MX’s powerful drawing methods to make your creative work more dynamic and interactive than ever before

Anyone fortunate (or old) enough to remember the heydays of BASIC on the Spectrum, BBC Micro or Commodore 64 will remember the DRAW and PLOT commands and the fun you could have with them. In Flash, before version MX, dynamic drawing was extremely limited and lacklustre. With the power of the drawing methods in Flash MX, dynamic interfaces and enhanced visual interactivity is achievable.

Flash MX’s drawing methods are all called through ActionScript. In the first part of this tutorial, we’ll introduce you to Flash’s drawing methods individually, enabling you to get a contextual understanding of how each one works with its peers. Then we’ll create a mini drawing application based on an old favourite drawing toy. We’ll finish off by looking at Flash MX’s ability to draw curves on-the-fly, by creating a dynamic image mask.

By the end of this article, you’ll be able to draw in the old-skool way! Before long, though, you’ll be creating flowing and lush interfaces – which aren’t just tweens! From this, you’ll notice that coding graphics is considerably lower on file size than real drawing, simply because ActionScript code optimises considerably.

The files necessary to complete this tutorial can be downloaded from the PDF.
Illustration: Scripting graphics in Flash

Click here to download the tutorial for free