# setInterval Parameters Dilemma

**URL:** <https://forum.kirupa.com/t/setinterval-parameters-dilemma/230625>\
**Category:** flash\
**Created:** [June 27, 2007, 6:56pm UTC](https://forum.kirupa.com/t/setinterval-parameters-dilemma/230625 "2007-06-27T18:56:26Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![nickcherryjiggz](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/nickcherryjiggz/32/2107_2.png) [@nickcherryjiggz](https://forum.kirupa.com/u/nickcherryjiggz)\
**Post date:** [June 27, 2007, 6:56pm UTC](https://forum.kirupa.com/t/setinterval-parameters-dilemma/230625/1 "2007-06-27T18:56:26Z")

</div>

I’m having some trouble coming up with a solution for this situation and would really appreciate some advice:

I have a function gameTimerInterval() set to run every half second. Every x of those intervals (the value of x varies in this situation), it creates another interval that calls the function birdTimerInterval() every y of these new intervals. Basically, gameTimerInterval() determines when a new flock of birds will enter, and then birdTimerInterval() controls how each individual bird in the flock comes in (one at a time). The thing is, there can be multiple flocks coming on the stage at the same time, so birdTimerInterval() will need to receive a parameter so it knows which group of birds to control. The only way I could see achieving this is doing something like dynamically passing the name of the interval that’s calling the function, as I don’t know how I could use global variables or arrays to distinguish which flock should be moving. Any thoughts?
