1. Home
  2. Computing & Technology
  3. Animation

Deconstructing the Paint Application IIX: User Layers, Clear Layer

By Adrien-Luc Sanders, About.com

3 of 5

Testing for Layer Activity: Layer 0

Thus far, all of our scripting for the various tools of the application has been contained inside various onClipEvent handlers assigned to a remote controller movie clip off-stage. They have, by default, been set to work no matter what. Now, however, we want to make sure that the existing controls only work to draw inside the "drawing" movie clip if layer 0 is active.

We do this by adding an if statement before any actions that take place in the onClipEvent handlers, to test to see if the value of the variable layerzero is true. If it’s not, then no drawing will take place, because all of the drawing commands should be nested inside that if statement.

There must be a separate if statement inside each onClipEvent handler (Load, enterFrame, mouseDown, mouseMove, mouseUp).

Explore Animation
About.com Special Features

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

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

  1. Home
  2. Computing & Technology
  3. Animation
  4. Flash Animation Tutorials
  5. Deconstructing the Paint Application IIX: User Layers, Clear Layer

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

All rights reserved.