PDA

View Full Version : disable button feature



pkcidstudio
October 7th, 2005, 04:07 PM
i have a serries of buttons that tallie up a score, something i would like to add to them is a way to disable the addition of other points. this way it would limit the amount of points one person could earn per turn. here is the script for the buttons.

on (release) {
_root.TeamA = _root.TeamA + 6;
_root.Earned = _root.Earned + 6;
gotoAndPlay("bargain_hunter", 6);
}


any help would be great

Lord Rahl
October 7th, 2005, 04:27 PM
To disable a button just do something like


on(release){
this.enabled=false;
//whatever else you want to add in
}

and make it true to reactivate it.

pkcidstudio
October 7th, 2005, 04:31 PM
does that get placed into the btn or on the root? i tried into the btn an it still doesnt disable it :( any ideas?

Lord Rahl
October 7th, 2005, 04:37 PM
If it doesn't work in that form, try switching the
this.enabled=false;
to the root form as you mentioned. So something like....
_root.BTN.enabled=false;

pkcidstudio
October 7th, 2005, 04:44 PM
works great thank you, i swear i tried that already but sometimes you just need to do it 51 times for it to work right

Lord Rahl
October 7th, 2005, 04:51 PM
works great thank you, i swear i tried that already but sometimes you just need to do it 51 times for it to work right
Yeah, I know how that is. :D