Animation

  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).

3 of 5

Index: Deconstructing the Paint Application IIX: User Layers, Clear Layer

  1. Setting Up Layer Buttons
  2. Creating Separate Movie Clips for Separate Layers
  3. Testing for Layer Activity: Layer 0
  4. Testing for Layer Activity: Layer 1
  5. Clear Layer

Explore Animation

More from About.com

Animation

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

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

All rights reserved.