# Restart a cleared Interval

**URL:** <https://forum.kirupa.com/t/restart-a-cleared-interval/270183>\
**Category:** flash\
**Created:** [September 6, 2008, 1:39am UTC](https://forum.kirupa.com/t/restart-a-cleared-interval/270183 "2008-09-06T01:39:25Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![cortezcreations](https://avatars.discourse-cdn.com/v4/letter/c/b782af/32.png) [@cortezcreations](https://forum.kirupa.com/u/cortezcreations)\
**Post date:** [September 6, 2008, 1:39am UTC](https://forum.kirupa.com/t/restart-a-cleared-interval/270183/1 "2008-09-06T01:39:25Z")

</div>

Hello there can anyone help me restart my setInterval after I’ve cleared it?

my code

function wait() {  
trace(“hello”) ;  
}

var timer = setInterval(wait,2000);

//then on a button I have

btn.onPress = function():Void {  
clearInterval(timer);  
}

I have this all working fine. It starts an animation and at the end of the animation I’d like to restart the interval.

Trying to figure out the function I need to create in order to restart my interval.

Thanks in advance, this one’s stumping me.
