PDA

View Full Version : Disable a button from click



daytonatkf
September 8th, 2006, 11:49 PM
i create a button using an image, i want to make the button to be click on first time only, inside the button there is a action script running a loop to generate some animation.

how do i make the button to be run for the first time the user click on the button? the second time the user click, the script will not be run, any idea , thanks

REEFˇ
September 8th, 2006, 11:50 PM
Well, in the on(release){} handlers, you could just add:


this.enabled = false

pips
September 9th, 2006, 06:17 AM
and if you would like to run another script instead:


on(release){
if(active){
//run some script
active = false;
} else {
//run another script
}
}