# Need help in setinterval

**URL:** <https://forum.kirupa.com/t/need-help-in-setinterval/284923>\
**Category:** Uncategorized\
**Created:** [March 25, 2009, 5:30am UTC](https://forum.kirupa.com/t/need-help-in-setinterval/284923 "2009-03-25T05:30:58Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![samyphp](https://avatars.discourse-cdn.com/v4/letter/s/8e7dd6/32.png) [@samyphp](https://forum.kirupa.com/u/samyphp)\
**Post date:** [March 25, 2009, 5:30am UTC](https://forum.kirupa.com/t/need-help-in-setinterval/284923/1 "2009-03-25T05:30:58Z")

</div>

hi there,  
am developing a game using action script2. in some situation my logic sets the setinterval like the following code…

var myInterval=setInterval(echo,2000);  
myInterval=setInterval(echo,2000);  
function echo(){  
clearInterval(myInterval);  
trace(“Hai”);  
}

that is setting the setinterval for two times for same variable…if this happens means the setInterval is not cleared as per my code…  
please anybody help me…if u want more details on this means, am ready to give…

thanks in advance,  
Palanisamy
