# Hold for 5 secs

**URL:** <https://forum.kirupa.com/t/hold-for-5-secs/5068>\
**Category:** flash\
**Created:** [August 30, 2002, 10:22am UTC](https://forum.kirupa.com/t/hold-for-5-secs/5068 "2002-08-30T10:22:10Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![johan](https://avatars.discourse-cdn.com/v4/letter/j/dec6dc/32.png) [@johan](https://forum.kirupa.com/u/johan)\
**Post date:** [August 30, 2002, 10:22am UTC](https://forum.kirupa.com/t/hold-for-5-secs/5068/1 "2002-08-30T10:22:10Z")

</div>

Hi everybody,

ive got a problem with a counter… i like to have it like this… its displays the time for 5 secs (ok, that no problem… here it comes…) theni want it to go to frame 2 and show that frame for 5 secs and back to frame 1 (almost like a loop)

is that possible? thanks in advance!!

Cheers!

/J.

---

<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 30, 2002, 5:13pm UTC](https://forum.kirupa.com/t/hold-for-5-secs/5068/2 "2002-08-30T17:13:21Z")

</div>

This script will loop over ‘n’ number of frames for ‘t’ seconds.  
Hope this helps you out!

pauseDuration = t\*1000;  
framesInLoop = n;

if (startTime == null) {  
startTime = getTimer();  
gotoAndPlay (\_currentframe-framesInLoop);  
} else {  
lapsedTime = getTimer()-startTime;  
if (lapsedTime \< pauseDuration) {  
gotoAndPlay (\_currentframe-framesInLoop);  
} else {  
startTime = null;  
}  
}

Peace

---

<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 30, 2002, 5:57pm UTC](https://forum.kirupa.com/t/hold-for-5-secs/5068/3 "2002-08-30T17:57:48Z")

</div>

Okay, Ryall… I’ve been a bad, bad, man… I’ve decided to not answer any posts until I look at yours. Going there now…

Sorry for the delay.

---

<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 30, 2002, 6:04pm UTC](https://forum.kirupa.com/t/hold-for-5-secs/5068/4 "2002-08-30T18:04:45Z")

</div>

=) Thanks a lot!!! No worries about the delay, I appreciate the help - whenever it comes!!

Peace
