# Timer working but not working

**URL:** <https://forum.kirupa.com/t/timer-working-but-not-working/209315>\
**Category:** flash\
**Created:** [December 7, 2006, 5:57pm UTC](https://forum.kirupa.com/t/timer-working-but-not-working/209315 "2006-12-07T17:57:23Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Atris](https://avatars.discourse-cdn.com/v4/letter/a/c4cdca/32.png) [@Atris](https://forum.kirupa.com/u/Atris)\
**Post date:** [December 7, 2006, 5:57pm UTC](https://forum.kirupa.com/t/timer-working-but-not-working/209315/1 "2006-12-07T17:57:23Z")

</div>

Hello all.

I have a timer in an include file called A5SecTimer.as

Code:  
//A FIVE SECOND TIMER THAT GOES TO THE NEXT FRAME  
function A5SecTimer(){  
setTimeout(this, “gotoAndPlay”, 5000, nextFrame());  
}  
A5SecTimer();

In my movie i reference the file in frame one of my movie as such  
#include “A5SecTimer.as”  
This works great, goes to the next frame but, when I include a new timer in the second frame  
Code:  
//A TWO SECOND TIMER THAT GOES TO THE NEXT FRAME  
function A2SecTimer(){  
setTimeout(this, “gotoAndStop”, 2000, nextFrame());  
}  
A2SecTimer();  
The movie skips the second frame and goes to the third.

This is what I’m trying to accomplish:  
-Fade in movie clip while movie is paused for 5 seconds  
-go to the next frame  
-Fade the movie clip while movie is paused for 5 seconds  
-go to next frame and stop.

I hope this isn’t too confusing to understand.

BOOYAKASHA!

-Atris
