I have a simple slideshow that is non-interactive. It just loops five movie clips loaded externally. Each slide is shown for a certain amount of time that is determined with getTimer.
The code for the slideshow is in the last frame of the root timeline. So, basically the slideshow starts when the root timeline finishes playing. The problem is that the timer works great the first time the code plays, but when I tell the player head to back up and enter the frame again, the clips play very rapidly, as though getTimer was not being initialized.
Here is the code:
stop();
square._alpha = 0;
mypic = 1;
_root.onEnterFrame = function() {
if (square._alpha<10) {
loadMovie(“images/image”+mypic+".swf", “square”);
fadeOut = false;
fadeIn = true;
}
if (square._alpha>10 && fadeOut) {
square._alpha -= 10;
}
if (square._alpha<100 && fadeIn && !fadeOut) {
square._alpha += 10;
} else {
fadeIn = false;
}
if (mypic>=10) {
mypic = 1;
startTimeSet = 0;
}
if (getTimer()>10000 && mypic<10 && !fadeIn && !fadeout && mypic == 1) {
fadeout = true;
mypic = 2;
}
if (getTimer()>15000 && mypic<10 && !fadeIn && !fadeout && mypic == 2) {
fadeout = true;
mypic = 3;
}
if (getTimer()>20000 && mypic<10 && !fadeIn && !fadeout && mypic == 3) {
fadeout = true;
mypic = 4;
}
if (getTimer()>25000 && mypic<10 && !fadeIn && !fadeout && mypic == 4) {
fadeout = true;
mypic = 5;
}
if (getTimer()>30000 && mypic<10 && !fadeIn && !fadeout && mypic == 5) {
fadeout = true;
startTimeSet = 0; //not sure if this is necessary - i think i’m telling getTimer
//to reset itself at this point?
gotoAndPlay(“rewind”); // telling the player head to back up a couple of
// frames and then play forward again to loop the images again
}
};