# setInterval

**URL:** <https://forum.kirupa.com/t/setinterval/57908>\
**Category:** Uncategorized\
**Created:** [July 17, 2004, 6:12pm UTC](https://forum.kirupa.com/t/setinterval/57908 "2004-07-17T18:12:26Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Moopers](https://avatars.discourse-cdn.com/v4/letter/m/b782af/32.png) [@Moopers](https://forum.kirupa.com/u/Moopers)\
**Post date:** [July 17, 2004, 6:12pm UTC](https://forum.kirupa.com/t/setinterval/57908/1 "2004-07-17T18:12:26Z")

</div>

ok, i have a question. Can anyone tell me how the setInterval command works?

i want it so that after you fire a laser from your spaceship, it takes 0.5 seconds to fire another.

thx.

---

<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:** [July 17, 2004, 11:49pm UTC](https://forum.kirupa.com/t/setinterval/57908/2 "2004-07-17T23:49:26Z")

</div>

setInterval(_function,time in ms_);

It calls the funtion every time the timer reaches the time in ms. It resets once it calls it.

setInterval(fireLaser,500);

Cool,

---

<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:** [July 18, 2004, 7:07am UTC](https://forum.kirupa.com/t/setinterval/57908/3 "2004-07-18T07:07:43Z")

</div>

Please use more descriptive titles Moopers. I moved this thread to AS too. Read this for more info on setInterval:  
[http://www.macromedia.com/support/flash/action\_scripts/actionscript\_dictionary/actionscript\_dictionary646.html](http://www.macromedia.com/support/flash/action_scripts/actionscript_dictionary/actionscript_dictionary646.html)
