Buttons, can they affect layers?

Can i make a button, when pressed, cause a layer to become visible or invisible?
If so, how?


What you are thinking of I don’t believe is possible, but I think I have an alternate solution. If possible take everything in the layer that you want to be invisble, convert the contents of that layer to a movieclip. Then the code is simple.

_root.layerClip._visible = false

This should help and it allows you to make the movieclip visible or invisible when every you want or after certain conditions are met.


No need to transform everything into a movie clip. Just give everything you want to turn invisible an instance name, and set them _visible = 0 ;

pom :asian:

Oops, your right Ilyaslamasse I keep forgeting about Flash Mx and its ability to give everything an instance name. I guess I was still in Flash 5 mode when I posted. Thanks that helped the both of us I think.


I have two background bitmaps turned into movieclips (Background1, Background2)

They are on 2 seperate layers. I then have a buttons with this code:

on(release) {
Background2._visible = false;

Why doesn’t Background2 hide, so I can see Background1 on the layer beneath?

I even tried giving Background2 the instance name Backg2 and changing the code to:
on(release) {
Backg2._visible = false;

Neither works. What am I overlooking?