# Disabling buttons for a certain amount of time

**URL:** <https://forum.kirupa.com/t/disabling-buttons-for-a-certain-amount-of-time/61065>\
**Category:** Uncategorized\
**Created:** [August 15, 2004, 3:46pm UTC](https://forum.kirupa.com/t/disabling-buttons-for-a-certain-amount-of-time/61065 "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/61065/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:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 15, 2004, 3:57pm UTC](https://forum.kirupa.com/t/disabling-buttons-for-a-certain-amount-of-time/61065/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);
