The first thing we need to do for this is set up the layer buttons. At the bottom of my applications control panel I have two buttons, one marked 0, the other marked 1; the application opens with layer 0 active and the layer 0 button highlighted. Clicking the layer 1 button would make layer 0 inactive and make layer 1 active; clicking it a second time even while layer 1 was active would make layer 1 inactive and make layer 0 active. The same works in reverse for layer 0.
How is this done? Instead of testing strictly for true/false values of variables representing the layer activity, instead simply add the following code to each button:
on (release){
_root.layerzero=!_root.layerzero;
_root.layerone=!_root.layerone;
}
Assuming that one layer starts off true and the other false (something well define in the next step), this code will always cause the two to switch when either button is clicked, because all it does is take the existing value of each one and convert it to its opposite.
Ive only created two layers on mine, but you could create as many as you wished.


