lundi 2 janvier 2017

How to disable a function for X seconds when another button clicked in As3?

I have simple question that it became complected for me which is:

I have a function which is called and run after around 11 seconds:

var myTimeoutClickObject = setTimeout(clickObject,11000); 
function clickObject():void{
  //My code

I also have a Reset Button that I made a Click Function for it:

reset_btn.addEventListener(MouseEvent.CLICK, reset);
function reset(e:MouseEvent):void{
  //My code

Now, I want to make the clickObject() function disabled for around 11 seconds again every time that I click on the reset_btn Button.

I really appreciate, if you can help me in this matter!

Thanks in advance!

Aucun commentaire:

Enregistrer un commentaire