# Need help getting timer to create a pause

**URL:** <https://forum.kirupa.com/t/need-help-getting-timer-to-create-a-pause/320699>\
**Category:** flash\
**Created:** [March 30, 2011, 8:30pm UTC](https://forum.kirupa.com/t/need-help-getting-timer-to-create-a-pause/320699 "2011-03-30T20:30:49Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mosk](https://avatars.discourse-cdn.com/v4/letter/m/b2d939/32.png) [@Mosk](https://forum.kirupa.com/u/Mosk)\
**Post date:** [March 30, 2011, 8:30pm UTC](https://forum.kirupa.com/t/need-help-getting-timer-to-create-a-pause/320699/1 "2011-03-30T20:30:49Z")

</div>

I know you can trigger a function by adding through a timer like this i ActionScript3:

```auto
myTimer.addEventListener(TimerEvent.TIMER_COMPLETE, timerDone);

```

But what I’m trying to do is just have a timer create a delay in between a couple of statements within the same function. Is that possible? And if so, could someone explain how to code it?

Something very simple would do, like

public function changeVar():void  
{  
myVar = “red”  
xxxTIMER CODE HERE  
myVar = “blue”  
}

How do I leave myVar equal to red for 5 seconds and then have it change to blue?

Thanks
