I’m using the AS below to cycle through photo’s which load from an array into an MC. BUT, what I really want to do is load into two different mc’s, with each mc having it’s own photo array. IE, it’s own set of photo’s. So basically photo 1 loads in MC_1 and 2 seconds later photo 6 loads into MC_2 and so on and so on.
//
stop();
pathToPics = “”;
pArray = [“pic1.jpg”, “pic2.jpg”, “pic3.jpg”, “pic4.jpg”];
pIndex = -1;
fadeSpeed = 1.5;
delay = 2000;
changePhoto = function () {
pIndex++;
clearInterval(myInterval);
onEnterFrame = fadeOut;
};
function fadeOut() {
if (frame_2._alpha>fadeSpeed) {
frame_2._alpha -= fadeSpeed;
} else {
//if there is a next picture, load it
if (pIndex<pArray.length) {
loadPhoto();
} else {
//set the last picture _alpha 0 and delete the onEnterframe
frame_2._alpha = 0;
onEnterFrame = null;
myInterval = setInterval(delay);
nextFrame();
}
}
}
function loadPhoto() {
var p = frame_2;
p._alpha = 0;
p.loadMovie(pathToPics+pArray[pIndex]);
onEnterFrame = loadMeter;
}
function loadMeter() {
var i, l, t;
l = frame_2.getBytesLoaded();
t = frame_2.getBytesTotal();
if (t>0 && t == l) {
onEnterFrame = fadeIn;
} else {
trace(l/t);
}
}
function fadeIn() {
if (frame_2._alpha<99-fadeSpeed) {
frame_2._alpha += fadeSpeed;
} else {
frame_2._alpha = 99;
//removed the if statement here
myInterval = setInterval(changePhoto, delay);
onEnterFrame = null;
}
}
myInterval = setInterval(changePhoto, delay);