# Set interval problem

**URL:** <https://forum.kirupa.com/t/set-interval-problem/312242>\
**Category:** Uncategorized\
**Created:** [July 29, 2010, 12:27am UTC](https://forum.kirupa.com/t/set-interval-problem/312242 "2010-07-29T00:27:16Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![duck123](https://avatars.discourse-cdn.com/v4/letter/d/eb8c5e/32.png) [@duck123](https://forum.kirupa.com/u/duck123)\
**Post date:** [July 29, 2010, 12:27am UTC](https://forum.kirupa.com/t/set-interval-problem/312242/1 "2010-07-29T00:27:16Z")

</div>

I have this function;  
onClipEvent (enterFrame) {  
function randRange(min:Number, max:Number):Number {  
var randomNum:Number = Math.floor(Math.random()\*(max-min+1))+min;  
return randomNum;  
}  
myInterval = setInterval(randRange, 2000);  
number = randRange(0,100);  
}  
I am trying to make Flash generate a number from 0 to 100 with a 2 second delay but I cant get the delay to work. The function just keeps popping numbers with no delay. Can anyone help please?  
Thank You
