# Is there some kind of wait command for actionscripts?

**URL:** <https://forum.kirupa.com/t/is-there-some-kind-of-wait-command-for-actionscripts/1741>\
**Category:** flash\
**Created:** [May 26, 2002, 2:45am UTC](https://forum.kirupa.com/t/is-there-some-kind-of-wait-command-for-actionscripts/1741 "2002-05-26T02:45:38Z")\
**Posts on this page:** 5\
**Page:** 1

<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 26, 2002, 2:45am UTC](https://forum.kirupa.com/t/is-there-some-kind-of-wait-command-for-actionscripts/1741/1 "2002-05-26T02:45:38Z")

</div>

i wanna know if theres a script that will make something wait a certain amount of time before continuing on with something… like for a hit test thing for example. if i wanted a number to increase when 2 things touch and did the scripting to do so, when they touch eachother the number whould raise really fast. Whouldnt there be a way to make it so when they touch the number will raise, wait however long i till it to, then raise again?

---

<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 26, 2002, 5:17am UTC](https://forum.kirupa.com/t/is-there-some-kind-of-wait-command-for-actionscripts/1741/2 "2002-05-26T05:17:45Z")

</div>

function fWait(){\rif (!\_root.nStart){\r\_root.nStart = getTimer();\r} else {\rif ((getTimer()-\_root.nStart)\>1000){\r\_root.nStart = getTimer();\r\_root.nCounter++;\r}\r}\r}\r\rwhen the ‘hit’ happens just call the function. the variable ‘\_root.nCounter’ will increment once every second. just change the ‘1000’ to whatever time (in milliseconds) you would like to wait.\r:) \rjeremy

---

<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 26, 2002, 10:09am UTC](https://forum.kirupa.com/t/is-there-some-kind-of-wait-command-for-actionscripts/1741/3 "2002-05-26T10:09:51Z")

</div>

You can also check the setInterval function. It was made exactly for that. But you’ll have to define a function.\r\rpom 0]

---

<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:** [June 1, 2002, 10:54pm UTC](https://forum.kirupa.com/t/is-there-some-kind-of-wait-command-for-actionscripts/1741/4 "2002-06-01T22:54:27Z")

</div>

well im really not that much of an expert with actionscripts and i dunno what the setinterval function thing is… so im lost ^^

---

<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:** [June 2, 2002, 2:56pm UTC](https://forum.kirupa.com/t/is-there-some-kind-of-wait-command-for-actionscripts/1741/5 "2002-06-02T14:56:05Z")

</div>

It’s explained in the Actionscript Dictionnary. Very well by the way.\r\rpom 0]
