# Need advice on proper setInterval coding

**URL:** <https://forum.kirupa.com/t/need-advice-on-proper-setinterval-coding/236212>\
**Category:** Uncategorized\
**Created:** [August 18, 2007, 11:42am UTC](https://forum.kirupa.com/t/need-advice-on-proper-setinterval-coding/236212 "2007-08-18T11:42:49Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![camoconnell\_com](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/camoconnell_com/32/3655_2.png) [@camoconnell\_com](https://forum.kirupa.com/u/camoconnell_com)\
**Post date:** [August 18, 2007, 11:42am UTC](https://forum.kirupa.com/t/need-advice-on-proper-setinterval-coding/236212/1 "2007-08-18T11:42:49Z")

</div>

hey there,

i was wondering if someone could pls help me to code the setInterval/clearInterval functions in a cleaner way?

[AS]  
var timer:Number;  
obj = new Object();

RHArrow.onRelease = function(){  
btnSlideOut();  
bgSlideRight();  
StagesWrap.slideTo(-952, 6, 1.5,“easeOutCirc”);  
obj.interval = function() {  
gotoAndPlay(2);  
getURL(‘renewal.html’,’\_self’);  
clearInterval(timer);  
}  
timer = setInterval( obj, “interval”, 1500 );  
}[/AS]

i need to apply this setInterval method to about eight other MC’s, except the gotoAndPlay and getURL will be different on each.

could an array help me here?

Thank you  
Cam
