How to disable buttons

This is what I have, a main nav bar on level 0.\rI have loaded another swf. on level 1\rThen I have a swf on level 20, the user can still see the lower levels but I don’t wnt the user to press any of those buttons.\r\rIs there a way to disable the buttons on level 0 and level 1 when level 20 is showing?\r\rThanks,\rMatt\r

only way i could think of is use a var in your button actions; set it to true at beginning and to false with the clip loaded into level 20, and put an if var=true check before executing the actions; cursor will still change though…

also, you could place the buttons inside movie clips, give those movie clips “instance” names, and then set the movie clip to _visible=false when ever you needed them disabled. _visible=true when you need the enabled.

Thanks for the suggestions. I guess there is no easy way of doing this.\r\rI have not worked with variables and if statements together do you know of a tut?\rI need the buttons visible but not active, thanks upuaut.\r\rThanks again.\rMatt

I got this script from another forum. Try this one, that MOVIE on level 20, on the last frame, add this script:

_parent.movieclip.buttonName.enabled = false;

I have tried the “enabled = true;” AS to some of my buttons and it worked.

I wrote something to make this idea rather easy for one project I was working on:



Button.prototype.disable = function() {
this.enabled = false;
this._alpha = 50;
}
Button.prototype.enable = function() {
this.enabled = true;
this._alpha = 100;
}

the way i wrote a write around was to use alpha invisible buttons, and using the visibility of the button as a means to click on or not, (I was playing with easter egging the main menu during a binary preloader where the button was hidden until a key press was used, so this way the hand form didn’t change on mouseover. but the binary counter could then be bypassed after the onkey event.)