# Setinterval problems

**URL:** <https://forum.kirupa.com/t/setinterval-problems/289780>\
**Category:** Uncategorized\
**Created:** [June 4, 2009, 5:08pm UTC](https://forum.kirupa.com/t/setinterval-problems/289780 "2009-06-04T17:08:20Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Fwoggie](https://avatars.discourse-cdn.com/v4/letter/f/898d66/32.png) [@Fwoggie](https://forum.kirupa.com/u/Fwoggie)\
**Post date:** [June 4, 2009, 5:08pm UTC](https://forum.kirupa.com/t/setinterval-problems/289780/1 "2009-06-04T17:08:20Z")

</div>

Hi,

I’ve got the ultimate noob question here, but I’ve been tearing my hair out on it for hours.

I’ve got two tweens, and want one to start 5 secs after the other:-

numberOfBanners = 2;  
count = 0;  
num = 1;  
import mx.transitions.Tween;  
import mx.transitions.easing.\*;

function Banner(num){  
count++  
var showBanner:Tween = new Tween(“Banner1”], “\_alpha”, Strong.easeIn, 0, 100, 1, true);  
var myInterval:Number;  
showBanner.onMotionFinished = function(){  
delete this[“Banner”+num].\_accProps.silent;  
myInterval = setInterval(pauseTween, 5000);  
};  
function pauseTween() {  
showBanner2.start();  
var showBanner2:Tween = new Tween(“Banner2”, “\_alpha”, Strong.easeIn, 100, 0, 1, true);  
showBanner.onMotionFinished = function(){  
delete this[“Banner2”].\_accProps.silent;  
}  
clearInterval(myInterval);  
}  
}

Does anyone have any idea where I’m going wrong? They both occur at the same time…

Thanks in advance…
