Animation

  1. Home
  2. Computing & Technology
  3. Animation

Deconstructing the Paint Application II: The Brush Tool & the Flash Drawing API

By Adrien-Luc Sanders, About.com

1 of 9

ActionScripting for the Brush Tool Button

Now that we’ve set up the base of the paint application and made the canvas color button work, let’s move on to the brush tool.

The first thing we’re going to do is define what happens when the brush tool is clicked. Mainly we just want Flash to know that the brush tool is now active - so that when it checks for certain conditions when the mouse is pressed, moved, or released, it knows how to behave. We’re again using that variable _root.isactive for this; last time we set the value to null/nothing, but this time we want to give it an actual value:

on (release) {
_root.isactive = “brush”;
}

Explore Animation

About.com Special Features

Build Your Own Website

Step-by-step advice on how to do everything from choosing a Web host to promoting your content. More >

Connect Your Home Computers

Easy ways to connect two computers for networking purposes. More >

Animation

  1. Home
  2. Computing & Technology
  3. Animation
  4. Flash Animation Tutorials
  5. Deconstructing the Paint Application II: The Brush Tool and the Flash Drawing API

©2009 About.com, a part of The New York Times Company.

All rights reserved.