# Problem with the Time Interval

**URL:** <https://forum.kirupa.com/t/problem-with-the-time-interval/194644>\
**Category:** Uncategorized\
**Created:** [July 25, 2006, 8:10am UTC](https://forum.kirupa.com/t/problem-with-the-time-interval/194644 "2006-07-25T08:10:17Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![leb](https://avatars.discourse-cdn.com/v4/letter/l/ba9def/32.png) [@leb](https://forum.kirupa.com/u/leb)\
**Post date:** [July 25, 2006, 8:10am UTC](https://forum.kirupa.com/t/problem-with-the-time-interval/194644/1 "2006-07-25T08:10:17Z")

</div>

Is this the correct way to write the code? i still cant work it out …

```auto

on(press){
array=[1,2,3,4,5,6,7,8,9]

int i = 0;
function runMe() {
     if (array* != undefined) {
          //run code with:
    trace(array* + "compare to " + array[i+1]);
    if (array*< array[i+1])
    {
       
        trace("X");
    }
    else
    {
        
        trace("XX");
                
    } 
     } else 
          clearInterval(intID);
     i++;
}

intID = setInterval(_root, "runMe", 2000);
}

```
