# Function pauseHere(pauseFor)

**URL:** <https://forum.kirupa.com/t/function-pausehere-pausefor/224433>\
**Category:** Uncategorized\
**Created:** [May 2, 2007, 11:43am UTC](https://forum.kirupa.com/t/function-pausehere-pausefor/224433 "2007-05-02T11:43:00Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Robot\_Lover](https://avatars.discourse-cdn.com/v4/letter/r/e9a140/32.png) [@Robot\_Lover](https://forum.kirupa.com/u/Robot_Lover)\
**Post date:** [May 2, 2007, 11:43am UTC](https://forum.kirupa.com/t/function-pausehere-pausefor/224433/1 "2007-05-02T11:43:00Z")

</div>

Hi everyone,

I am just puzzling through someone else’s actionscript. Can anyone tell me why you would use this kind of function in the first frame of a main timeline. What should the code below be doing. I tried cutting it out and it doesn’t seem to affect anything as far as i can tell.

* * *

function pauseHere(pauseFor){  
pauseDuration = pauseFor\*1000;  
framesInLoop = 1;  
if (startTime == null) {  
startTime = getTimer();  
gotoAndPlay(\_currentframe-framesInLoop);  
} else {  
lapsedTime = getTimer()-startTime;  
if (lapsedTime\<pauseDuration) {  
gotoAndPlay(\_currentframe-framesInLoop);  
} else {  
startTime = null;  
}  
}  
}

* * *

thanks for your help
