A person at Macromedia forums gave me this, stating that
following actionscript code below should do what I want it to do with regaurds to getting the .swf files to rotate at random. I’m sure it does work according to how he coded it. But I think he has misunderstood my labeling of my .swf files for rotation? My .swf file start at “r_pic01.swf”, and end at “r_pic56” making a total of 56 .swf files. From observing his code; line 12 of the code gives the number 57 being the highest possible number. When the highest number should be 56. Also I think he failed to realize that my files number values are 01,02,03…ect,ect when less than the value of 10. If I am correct on this suspect mistake, can it be fixed accordingly so that it will work?
Array.prototype.shuffle = function() {
for (var ivar = this.length-1; ivar>=0; ivar--) {
var p = random(ivar);
var t = this[ivar];
this[ivar] = this[p];
this[p] = t;
}
};
var intervalVar = 20.0;
// delay between rotating images (in seconds)
object_list = new Array();
for (var ivar = 0; ivar<57; ivar++) {
if (ivar<10) {
object_list[ivar] = new objectItem("/services/pics/r_pic0"+ivar+".swf");
} else {
object_list[ivar] = new objectItem("/services/pics/r_pic"+ivar+".swf");
}
}
object_list.shuffle();
_root.createEmptyMovieClip("targetMC", _root.getNextHighestDepth());
loadI = setInterval(loadF, intervalVar*1000);
function loadF() {
if (!repeatCall) {
repeatCall = 0;
}
targetMC.loadMovie(object_list[repeatCall]);
repeatCall++;
if (repeatCall>=object_list.length) {
clearInterval(loadI);
}
}
Thanks,
Aaron