# Timer in timer

**URL:** <https://forum.kirupa.com/t/timer-in-timer/305253>\
**Category:** flash\
**Created:** [February 22, 2010, 12:16pm UTC](https://forum.kirupa.com/t/timer-in-timer/305253 "2010-02-22T12:16:18Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![SLaY](https://avatars.discourse-cdn.com/v4/letter/s/ac91a4/32.png) [@SLaY](https://forum.kirupa.com/u/SLaY)\
**Post date:** [February 22, 2010, 12:16pm UTC](https://forum.kirupa.com/t/timer-in-timer/305253/1 "2010-02-22T12:16:18Z")

</div>

Hey guys, i’m having a problem doing this, i have a timer in a timer, but it only runs once, after the first time only the second timer works

var rolltime:Timer = new Timer (5000);  
rolltime.addEventListener(TimerEvent.TIMER ,rollnow);  
rolltime.start();  
function rollnow(event:TimerEvent):void  
{  
rolltime2.start();  
}

var rolltime2:Timer = new Timer (5000,4);  
rolltime2.addEventListener(TimerEvent.TIMER ,rollnow2);

function rollnow2(event:TimerEvent):void  
{  
change\_question();  
}

So how should I do this in order to when the second timer ends it will only start after the first one ?

I need something like this:

First Timer -\> Second Timer -\> change\_question();  
First Timer -\> Second Timer -\> change\_question();  
First Timer -\> Second Timer -\> change\_question();  
First Timer -\> Second Timer -\> change\_question();

And what i think it’s happening is this:

First Timer -\> Second Timer -\> change\_question(); (10 secs)  
Second Timer -\> change\_question(); (5 secs)  
Second Timer -\> change\_question(); (5 secs)  
Second Timer -\> change\_question(); (5 secs)

Tks in advance
