1. Computing

Deconstructing the Paint Application IIX: User Layers, Clear Layer

By

4 of 5

Testing for Layer Activity: Layer 1
Deconstructing the Paint Application IIX: User Layers, Clear Layer
What about layer 1, though? We could do this the hard way and set up an else statement that says in all other instances (in other words, when layerone=true and layerzero=false), then all drawing activity should take place on the movie clip named “layer”, on layer 1 above the layer 0 movie clip “drawing”.

Personally, I find that to be a little messy to keep track of. So, to make things neater, instead I simply copied all the ActionScripts and assigned them to a second remote controller movie clip, changed the if statement to test for layer 1 instead of layer 0, and changed the name of the movie clip acted on from “drawing” to “layer”.

This way, whenever any action is taken regardless of the active tool, Flash checks to see which layer is active. If layer 0 is active, all drawing takes place inside the “drawing” movie clip; if layer 1 is active, all drawing takes place inside the “layer” movie clip above it.

©2014 About.com. All rights reserved.