PDA

View Full Version : Can buttons be disabled/enabled set invisible/visible


angelas
07-24-2001, 03:57 PM
I have four buttons that I want to hide when another button is clicked. Is there a way to disable them or make them invisible? I need to enable them or make them visible when I click the button a second time as well.

I looked for something in my Flash 5 books but I found nothing that would help.

Any ideas?

ARA Kenny
07-24-2001, 09:03 PM
Angela,

This is a simple problem with a pretty simple solution.

1. Put your buttons in four separate movie clips, and name each movieClip by the button (button1,button2, and so on).Put a stop() action in the first frame of each of these movie clips and put a second blank frame after the first frame that contains the button.
2. Set up another "smart clip" that does this:

Frame 1:
actions:
if (_parent.hideB1){
_parent.Button1.gotoandstop(2);
}
else {_parent.Button1.gotoandstop(1);}

if (_parent.hideB2){
_parent.Button2.gotoandstop(2);
}
else {_parent.Button2.gotoandstop(1);}

if (_parent.hideB3){
_parent.Button3.gotoandstop(2);
}
else {_parent.Button3.gotoandstop(1);}

if (_parent.hideB4){
_parent.Button4.gotoandstop(2);
}
else {_parent.Button4.gotoandstop(1);}


Frame 2:
gotoandplay(1);

Put this "smart clip" in the same timeline as your button movie clips. Now for the actions on each button. On button1 actions do this:
on (press){
_parent._parent.hideB2 = !(_parent._parent.hideB2);
_parent._parent.hideB3 = !(_parent._parent.hideB2);
_parent._parent.hideB4 = !(_parent._parent.hideB2);
}

And do the same for each button, except you need to always exclude the button itself, therefore on button three, you don't change _parent._parent.hideB3, and so on. Any questions email me at genesiswebdesign@hotmail.com.
Kenny