# Function not listening to setInterval array

**URL:** <https://forum.kirupa.com/t/function-not-listening-to-setinterval-array/163557>\
**Category:** flash\
**Created:** [September 23, 2005, 11:34am UTC](https://forum.kirupa.com/t/function-not-listening-to-setinterval-array/163557 "2005-09-23T11:34:51Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Oli\_G](https://avatars.discourse-cdn.com/v4/letter/o/f05b48/32.png) [@Oli\_G](https://forum.kirupa.com/u/Oli_G)\
**Post date:** [September 23, 2005, 11:34am UTC](https://forum.kirupa.com/t/function-not-listening-to-setinterval-array/163557/1 "2005-09-23T11:34:51Z")

</div>

Hi all,

I have a random array of times in milliseconds, of which I want a function to be called on. Problem is, it seems to be ignoring the times in the array, and instead using the number of items in the array as a guage of how fast it should call the function. Any pointers?

Cheers

```auto
 thingIntervals = new Array(200, 3000, 5000);
createThingSpeed = Math.ceil(Math.random()*thingIntervals.length*1000);
createThingID = setInterval(attachAnim, createThingSpeed);
thisThing = 0;
function attachAnim() {
     _root.attachMovie("item"+Math.ceil(Math.random()*7)+"path"+Math.ceil(Math.random()*4), newAnimation, thisThing++);
} 

```
