# Delay between click and performing action?

**URL:** https://forum.kirupa.com/t/delay-between-click-and-performing-action/20661
**Category:** Uncategorized
**Created:** [May 12, 2003, 1:24am UTC](https://forum.kirupa.com/t/delay-between-click-and-performing-action/20661 "2003-05-12T01:24:29Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![rampid360](https://avatars.discourse-cdn.com/v4/letter/r/a88e57/32.png) [@rampid360](https://forum.kirupa.com/u/rampid360)
#### Post date: [May 12, 2003, 1:24am UTC](https://forum.kirupa.com/t/delay-between-click-and-performing-action/20661/1 "2003-05-12T01:24:29Z")

</div>

is there a way to have a delay, say four or so frames between release and the time when the action takes place?

TIA  
-Al

---

<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: [May 12, 2003, 3:03am UTC](https://forum.kirupa.com/t/delay-between-click-and-performing-action/20661/2 "2003-05-12T03:03:54Z")

</div>

in performing an action, you can use this very simple code.  
place this code on a certain frame:

[AS]  
ifFrameLoaded (1) {  
timeToDelay = 5; // change to vary the time of delay.  
delay = 0;  
delay = j;  
if (delay\<timeToDelay) {  
prevFrame ();  
play ();  
j++;  
} else {  
nextFrame ();  
play ();  
j = 0;  
}  
}[/AS]

Hope it helps. :thumb:
