Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Whast the code to disable a button 1

Status
Not open for further replies.

Firehawk734

Technical User
Jan 22, 2002
155
US
Whast the code to disable a button once it has already been pressed and loaded an external movie into a level above your "MAIN" movie?

AND WHERE DO YOU PUT THE CODE?
 
Here's one way of doing it:


But remember, this should only be temporary, your button being disabled while that selection is displayed only! Once another selection is displayed you have to re-enable your button, so that the user can go back to the previous selection. Regards,

oldman3.gif
 
Well...
If you used...

blueButton.enabled = false;

...To disable it, then on all the other buttons scripts, you would add:

blueButton.enabled = true;

As for the wipe thing, maybe... Just maybe, over the weekend.

Regards,

oldman3.gif
 
Ok so, if I use the methods above,

then say if I had 5 main buttons, i would have to put

blueButton.enabled = true;
greenButton.enabled = true;
redButton.enabled = true;
yellowButton.enabled = true;


Something like that on all the other buttons then correct?
 
hi guys!

if i wanted to make it so that all my buttons were disabled, (except for the back button in my movie) is there a way to do that, or do i have to specify every button on the screen with an instance name?

basically, each button loads a movie clip symbol, and whilst that movie clip is playing i dont want any of the buttons to be clickable, except the one which closes said movie clip.

any ideas?
p.

 
styleBunny, I also posted this in your other thread:

Code:
function disableButtons(){
    butArray = new Array("but1","but2","but3","but4","but5");
    for(i=1;i<=butArray.length;i++){
        (_root[&quot;but&quot;+i].enabled)?(_root[&quot;but&quot;+i].enabled=0):(_root[&quot;but&quot;+i].enabled=1);
    }
}

Then just call the function from somewhere:

Code:
_root.disableButtons();

This will enable all your buttons that have their instance names in the array, if they are disabled. If they are enabled, it will disable them. frozenpeas
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top