# How can I delay the click event to occur after 10 seconds delay?

**URL:** <https://forum.kirupa.com/t/how-can-i-delay-the-click-event-to-occur-after-10-seconds-delay/635624>\
**Category:** flash\
**Created:** [December 5, 2016, 7:40pm UTC](https://forum.kirupa.com/t/how-can-i-delay-the-click-event-to-occur-after-10-seconds-delay/635624 "2016-12-05T19:40:20Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![LearnerFlashPro](https://avatars.discourse-cdn.com/v4/letter/l/e274bd/32.png) [@LearnerFlashPro](https://forum.kirupa.com/u/LearnerFlashPro)\
**Post date:** [December 5, 2016, 7:40pm UTC](https://forum.kirupa.com/t/how-can-i-delay-the-click-event-to-occur-after-10-seconds-delay/635624/1 "2016-12-05T19:40:20Z")

</div>

I would like to delay the button click event to trigger for 10 seconds after I press the button. The following is the Actionscript3 code I am using now. I want to delay the GLButton mouse click event.

stop();

import com.greensock._;  
import com.greensock.easing._;  
import com.greensock.plugins.\*;  
import com.greensock.events.LoaderEvent;

import com.greensock.loading.ImageLoader;  
import com.greensock.loading.LoaderMax;  
import com.greensock.loading.SWFLoader;  
import com.greensock.loading.VideoLoader;  
import com.greensock.loading.display.ContentDisplay;  
import flash.display.MovieClip;

import fl.transitions.Tween;  
import fl.transitions.TweenEvent;  
import fl.transitions.easing.\*;

Messages.GLButton.addEventListener(MouseEvent.CLICK, btnClick);

function btnClick(event:MouseEvent):void {  
var X1pos:Number = 0;  
var Y1pos:Number = 0;  
var SWF1:MovieClip;  
var loader1:Loader = new Loader();  
var currentSWF:String = “FireWorks.swf”;

```
    var newSWFRequest:URLRequest = new URLRequest(currentSWF);
    loader1.load(newSWFRequest);
    loader1.x = X1pos;
    loader1.y = Y1pos;
    SWFContainer.addChild(loader1);
	
	loader1.mask = SWFContainer.MaskArea
    }
```

---

<div class="post-metadata">

**Author:** ![senocular](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/senocular/32/7217_2.png) [@senocular](https://forum.kirupa.com/u/senocular)\
**Post date:** [December 5, 2016, 9:11pm UTC](https://forum.kirupa.com/t/how-can-i-delay-the-click-event-to-occur-after-10-seconds-delay/635624/2 "2016-12-05T21:11:22Z")

</div>

You should be able to put the contents of the btnClick function in a setTimeout call which will let you delay it by whatever you want (in ms, so 10000 for 10 seconds).
