# Disabling buttons for a certain amount of time

**URL:** <https://forum.kirupa.com/t/disabling-buttons-for-a-certain-amount-of-time/119490>\
**Category:** Uncategorized\
**Created:** [August 15, 2004, 3:46pm UTC](https://forum.kirupa.com/t/disabling-buttons-for-a-certain-amount-of-time/119490 "2004-08-15T15:46:19Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![bigbadmilkman](https://avatars.discourse-cdn.com/v4/letter/b/9fc348/32.png) [@bigbadmilkman](https://forum.kirupa.com/u/bigbadmilkman)\
**Post date:** [August 15, 2004, 3:46pm UTC](https://forum.kirupa.com/t/disabling-buttons-for-a-certain-amount-of-time/119490/1 "2004-08-15T15:46:19Z")

</div>

I was wondering if there is any way in flash, that you can disable a button for a few seconds, so that it cannot be clicked again.

You see i am using dynamic transitions to load external swf’s, and if the user clicks a button whilst the external animation is playing nothing will happen, giving them the impression that the button doesn’t work.

Any help would be appreciated.

thanks

---

<div class="post-metadata">

**Author:** ![stringy](https://avatars.discourse-cdn.com/v4/letter/s/919ad9/32.png) [@stringy](https://forum.kirupa.com/u/stringy)\
**Post date:** [August 15, 2004, 3:57pm UTC](https://forum.kirupa.com/t/disabling-buttons-for-a-certain-amount-of-time/119490/2 "2004-08-15T15:57:08Z")

</div>

> [@bigbadmilkman](#):
>
> I was wondering if there is any way in flash, that you can disable a button for a few seconds, so that it cannot be clicked again.
> 
> You see i am using dynamic transitions to load external swf’s, and if the user clicks a button whilst the external animation is playing nothing will happen, giving them the impression that the button doesn’t work.
> 
> Any help would be appreciated.
> 
> thanks

I`m sure you should beable to use the button.enabled property somewhere within the script you have. Anyway this will disable myButton for 5seconds  
function dontwork(btn) {  
btn.enabled = false;  
clearinterval(myinterval);  
myinterval2 = setInterval(getworking, 5000, btn);  
}  
function getworking(btn1) {  
btn1.enabled = true;  
clearInterval(myinterval2);  
}  
myinterval = setInterval(dontwork, 20, myButton);
