PDA

View Full Version : Hiding Buttons On A Dynamic Menu


systemfx
08-06-2003, 12:31 AM
Hi all,

I am wondering if someone can help me out with this. I have designed a dynamic menu. So far all elements of my menu (4 buttons) all work and everything is great. EXCEPT I would like to
hide one of the buttons based upon the value of a variable which is brought into the menu using FLASHVARS Method.

The values can ONLY be 1 to 4. If the value of my variable = 4 then the 4 button on my menu must be hidden from sight.

I can't seem to get it right, as I have been messing with the button's property _visibility=0; This does NOT hide my button from user. Can anyone help me out?


Thanx in advance...

annexion
08-06-2003, 01:54 AM
_visibility is boolean, meaning it's true or false.

mcName._visible=true;
mcName._visible=false;

systemfx
08-07-2003, 08:09 AM
The code you gave me didnt work for what I am doing.

It may be because I am putting this code in my AS layer of my menu and not in the actual button layer??

Heres my code.

if (_root.f_package_id==1) {
mcbutton_4._visible=false;
} else if (_root.f_package_id==2) {
mcbutton_4._visible=false;
} else if (_root.f_package_id==3) {
mcbutton_4._visible=false;
} else if (_root.f_package_id==4) {
mcbutton_4._visible=true;
} else {
}

the name of the BUTTON is button_4 and IS NOT a MovieClip, just a standard type of button.

so far this not working.

Any ideas?

binkyboo
08-07-2003, 11:28 AM
First I would make sure that the path to mcbutton_4 is correct. Is your button on the _root level along with the code? Also, how is the variable f_package_id being set?

systemfx
08-07-2003, 06:15 PM
Thanx for the help! I got it working finally. it didnt like the mcbutton_4 notation, so when I called it button_4._visible=false;
it finally worked.

Thanx a ton dude :))

Cheers