# How do i continually check for elapsed time?

**URL:** <https://forum.kirupa.com/t/how-do-i-continually-check-for-elapsed-time/244321>\
**Category:** flash\
**Created:** [November 16, 2007, 11:56am UTC](https://forum.kirupa.com/t/how-do-i-continually-check-for-elapsed-time/244321 "2007-11-16T11:56:29Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![quddusaliquddus](https://avatars.discourse-cdn.com/v4/letter/q/f475e1/32.png) [@quddusaliquddus](https://forum.kirupa.com/u/quddusaliquddus)\
**Post date:** [November 16, 2007, 11:56am UTC](https://forum.kirupa.com/t/how-do-i-continually-check-for-elapsed-time/244321/1 "2007-11-16T11:56:29Z")

</div>

Hi all,  
Im trying to tell a movie clip (placed on the main timeline) to goto the next frame when a certain interval of time has lapsed. And when a further amount of time has lapsed I want it to tell the movie clip to go the next frame.  
Can someone please help me do this.  
So far I’ve got this:

```auto

stop();
var so:SharedObject = SharedObject.getLocal("user");
if (so.size == 0)
{
    // Shared object doesn't exist.
 trace("created...");
    so.data.now = new Date().time;
}
var ageMS:Number = new Date().time - so.data.now;
trace("SharedObject was created " + Number(ageMS / 1000 / 60).toPrecision(2) + " minutes ago");
trace("SharedObject is " + so.size + " bytes");
so.flush();
if (ageMS / 1000>5){
 this.P.gotoAndStop(1);
 // this.P.nextFrame();
}
else
if (ageMS / 1000>10){
 this.P.gotoAndStop(2);
 // this.P.nextFrame();
}

```

Where P is the movie im tryig to manupulate.  
But it doest work. ☹  
Please help.  
Regards  
Q
