1. Computing

Deconstructing the Paint Application IIX: User Layers, Clear Layer

By

5 of 5

Clear Layer
Deconstructing the Paint Application IIX: User Layers, Clear Layer
Setting the Clear Layer button to erase the contents of the currently active/selected layer is easy. Just test for layer activity using an if statement, and then use the clear() function to erase its contents accordingly:
on (release) { 
 if (_root.layerzero==true){ 
_root.drawing.clear(); 
_root.isactive=null; 
 } 
if (_root.layerone==true){ 
_root.layer.clear(); 
_root.isactive=null; 
 }

You’ll notice that I also set the active tool to “null”, so that after a layer is cleared there is no painting/drawing tool selected.

©2014 About.com. All rights reserved.