Multiple slideshows

I’ve followed along the slideshow tutorial for the photo gallery, it was great, but I was wondering how do I put multiple slideshows in a flash movie? Each one playing a different set of images. I’ve tried creating another empty movie clip and a new instance of it and then applying the code into a new layer with changes to the function and variable names but only one slideshow will play, the other just stays blank.

Could anyone help me out with this? Thank you.

Welcome to kirupaforums =)

http://www.kirupa.com/forum/showthread.php?t=87388 the multiple resize
and you can find a more dynamic version here
http://www.kirupa.com/forum/showthread.php?t=213873

scotty(-:

hehe, glad to be here scotty, you’ve done a great job with the albums man, but what I want is multiple slideshows where the images play through an xml list automatically.

They were just examples to show you how you could setup multiple galleries, it shouldn’t be that hard to add setInterval that plays through the different galleries :slight_smile:

scotty(-:

I’m able to play through one gallery, but I want to be able to play through two galleries at the same time, any pointers on doing that?

I have two empty movie clips, one called picture and the other picture 2 to hold the images for the slideshow, the code for picture is as below:

delay = 3000;
//-----------------------
function loadXML(loaded) {

if (loaded) {

xmlNode = this.firstChild;
image = [];
description = [];
total = xmlNode.childNodes.length;
for (i=0; i<total; i++) {

image* = xmlNode.childNodes*.childNodes[0].firstChild.nodeValue;

}
firstImage();

} else {

content = “file not loaded!”;

}

}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load(“channel2.xml”);

p = 0;
this.onEnterFrame = function() {

filesize = picture.getBytesTotal();
loaded = picture.getBytesLoaded();

if (picture._alpha<100) {

picture._alpha += 10;

}

};
function nextImage() {

if (p<(total-1)) {

p++;
if (loaded == filesize) {

picture._alpha = 0;
picture.loadMovie(image[p], 1);
picture_num();
slideshow();

}

}

}

function firstImage() {

if (loaded == filesize) {

picture._alpha = 0;
picture.loadMovie(image[0], 1);
desc_txt.text = description[0];
picture_num();
slideshow();

}

}

function slideshow() {

myInterval = setInterval(pause_slideshow, delay);
function pause_slideshow() {

clearInterval(myInterval);
if (p == (total-1)) {

p = 0;
firstImage();

} else {

nextImage();

}

}

}

the code for picture2 is below:

delay2 = 3000;
//-----------------------
function loadXML2(loaded2) {

if (loaded2) {

xmlNode2 = this.firstChild;
image2 = [];
total2 = xmlNode2.childNodes.length;
for (i=0; i<total2; i++) {

image2* = xmlNode2.childNodes*.childNodes[0].firstChild.nodeValue;

}

firstImage2();

} else {

content = “file not loaded!”;

}

}

xmlData2 = new XML();
xmlData2.ignoreWhite = true;
xmlData2.onLoad = loadXML2;
xmlData2.load(“channel3.xml”);

p2 = 0;

this.onEnterFrame = function() {

filesize2 = picture2.getBytesTotal();
loaded2 = picture2.getBytesLoaded();

if (picture2._alpha<100) {

picture2._alpha += 10;

}

};

function nextImage2() {

if (p2<(total2-1)) {

p2++;
if (loaded2 == filesize2) {

picture2._alpha = 0;
picture2.loadMovie(image2[p2], 1);
slideshow2();

}

}

}

function firstImage2() {

if (loaded2 == filesize2) {

picture2._alpha = 0;
picture2.loadMovie(image2[0], 1);
slideshow2();

}

}

function slideshow2() {

myInterval2 = setInterval(pause_slideshow2, delay2);
function pause_slideshow2() {

clearInterval(myInterval2);
if (p2 == (total2-1)) {

p2 = 0;
firstImage2();

} else {

nextImage2();

}

}

}

i’m still unable to detect what I have done wrong and the two slideshows can’t play simultaneously, but both works fine individually.

Post your files?

scotty(-:

i’ve finally figured out the problem scotty, it’s the onEnterFrame function and the transparency. if you see my code I had two seperate onEnterFrame functions to fade in the image from 0 transparency, all I had to do was merge them into one and it works like a charm right now. Thanks dude.

you’re welcome =)