# Run Away setInterval... eeek!

**URL:** <https://forum.kirupa.com/t/run-away-setinterval-eeek/191621>\
**Category:** flash\
**Created:** [June 21, 2006, 8:54pm UTC](https://forum.kirupa.com/t/run-away-setinterval-eeek/191621 "2006-06-21T20:54:04Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![timmcguckin](https://avatars.discourse-cdn.com/v4/letter/t/4491bb/32.png) [@timmcguckin](https://forum.kirupa.com/u/timmcguckin)\
**Post date:** [June 21, 2006, 8:54pm UTC](https://forum.kirupa.com/t/run-away-setinterval-eeek/191621/1 "2006-06-21T20:54:04Z")

</div>

I would like the loop to create the multiple setInterval’s based off the array, but the function called is not clearing the setInterval…

Anyone?

var timecode = new Array(1, 2, 3, 4);

// use the array to assign the interval  
for (var i = 0; i\<timecode.length; i++) {  
timer\* = setInterval(myCuePoint, ((timecode\*)_1000), i);  
trace(timecode_);  
}

// The function called from the setInterval  
function myCuePoint(i) {  
clearInterval(timer\*);  
trace(“test”+i)  
}
