I need some help understanding for loop and timers and what I want to do is set the timer so it counts. Every 3 seconds add 1 to the count and then call a function. If the count reaches 3 then reset every thing and start over. But it isn’t working the way I want it too.
//create timer for slide show
var delay:uint = 3000;
var myTimer:Timer = new Timer(delay);
myTimer.addEventListener(TimerEvent.TIMER, loopImages, false, 0, true);
myTimer.start();
function loopImages(event:TimerEvent):void {
for (var i:Number = 0; i < 4; i++) {
trace(i);
if (i==0) {
loadPhoto0();
} else if (i==1) {
loadPhoto1();
} else if (i==2) {
loadPhoto2();
} else if (i==3) {
loadPhoto3();
} else if (i==4) {
i==0;
}
}
}