# Making variable wait

**URL:** <https://forum.kirupa.com/t/making-variable-wait/7112>\
**Category:** Uncategorized\
**Created:** [October 24, 2002, 12:34am UTC](https://forum.kirupa.com/t/making-variable-wait/7112 "2002-10-24T00:34:47Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![buddylee](https://avatars.discourse-cdn.com/v4/letter/b/e5b9ba/32.png) [@buddylee](https://forum.kirupa.com/u/buddylee)\
**Post date:** [October 24, 2002, 12:34am UTC](https://forum.kirupa.com/t/making-variable-wait/7112/1 "2002-10-24T00:34:47Z")

</div>

Is there any way to tell a movie clip or whatever to wait 3 seconds perform becoming active? I am not educated with AS at all, but I was wondering if say my fps is 12, so I could tell it to wait 36 frames then GO. Is that possible?  
Thanks

---

<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:** [October 24, 2002, 12:55am UTC](https://forum.kirupa.com/t/making-variable-wait/7112/2 "2002-10-24T00:55:33Z")

</div>

In your main “action” timeline, frame 1 put the following code:

////////////////// Pause Function /////////////////////  
this.createEmptyMovieClip(“timer”,50 );  
timer.onEnterFrame = function()  
{  
if (this.startTime\>0 )  
{  
var diff = getTimer()-this.startTime;  
if (diff\>this.timerLength)  
{  
this.target.play();  
this.startTime = 0;  
}  
}  
};  
function pauseFor(theTime)  
{  
stop();  
timer.timerLength = theTime;  
timer.startTime = getTimer();  
timer.target = this;  
}  
///////////////////////////////////////////////////

Then on the frame you want to pause, add: pauseFor(3000 ) //this would pause for 3 seconds.

There are many other ways, but I often use this way.

EDIT:, my stupid little mistake has been fixed.

---

<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:** [October 24, 2002, 1:35am UTC](https://forum.kirupa.com/t/making-variable-wait/7112/3 "2002-10-24T01:35:06Z")

</div>

Well thanks man, that sure does look like you worked hard on that. I will use this in my movie if you dont mind.

Thank You
