# Multiple slideshows

**URL:** <https://forum.kirupa.com/t/multiple-slideshows/185416>\
**Category:** Uncategorized\
**Created:** [April 13, 2006, 8:07am UTC](https://forum.kirupa.com/t/multiple-slideshows/185416 "2006-04-13T08:07:16Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![seraphangel](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/seraphangel/32/2354_2.png) [@seraphangel](https://forum.kirupa.com/u/seraphangel)\
**Post date:** [April 13, 2006, 8:07am UTC](https://forum.kirupa.com/t/multiple-slideshows/185416/1 "2006-04-13T08:07:16Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![scotty](https://avatars.discourse-cdn.com/v4/letter/s/91b2a8/32.png) [@scotty](https://forum.kirupa.com/u/scotty)\
**Post date:** [April 13, 2006, 8:14am UTC](https://forum.kirupa.com/t/multiple-slideshows/185416/2 "2006-04-13T08:14:18Z")

</div>

Welcome to kirupaforums =)

[http://www.kirupa.com/forum/showthread.php?t=87388](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](http://www.kirupa.com/forum/showthread.php?t=213873)

scotty(-:

---

<div class="post-metadata">

**Author:** ![seraphangel](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/seraphangel/32/2354_2.png) [@seraphangel](https://forum.kirupa.com/u/seraphangel)\
**Post date:** [April 13, 2006, 8:49am UTC](https://forum.kirupa.com/t/multiple-slideshows/185416/3 "2006-04-13T08:49:03Z")

</div>

> [@scotty](#):
>
> Welcome to kirupaforums =)
> 
> [http://www.kirupa.com/forum/showthread.php?t=87388](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](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.

---

<div class="post-metadata">

**Author:** ![scotty](https://avatars.discourse-cdn.com/v4/letter/s/91b2a8/32.png) [@scotty](https://forum.kirupa.com/u/scotty)\
**Post date:** [April 13, 2006, 9:44am UTC](https://forum.kirupa.com/t/multiple-slideshows/185416/4 "2006-04-13T09:44:52Z")

</div>

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 🙂

scotty(-:

---

<div class="post-metadata">

**Author:** ![seraphangel](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/seraphangel/32/2354_2.png) [@seraphangel](https://forum.kirupa.com/u/seraphangel)\
**Post date:** [April 14, 2006, 12:53am UTC](https://forum.kirupa.com/t/multiple-slideshows/185416/5 "2006-04-14T00:53:42Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![seraphangel](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/seraphangel/32/2354_2.png) [@seraphangel](https://forum.kirupa.com/u/seraphangel)\
**Post date:** [April 14, 2006, 8:06am UTC](https://forum.kirupa.com/t/multiple-slideshows/185416/6 "2006-04-14T08:06:38Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![scotty](https://avatars.discourse-cdn.com/v4/letter/s/91b2a8/32.png) [@scotty](https://forum.kirupa.com/u/scotty)\
**Post date:** [April 14, 2006, 8:26am UTC](https://forum.kirupa.com/t/multiple-slideshows/185416/7 "2006-04-14T08:26:35Z")

</div>

Post your files?

scotty(-:

---

<div class="post-metadata">

**Author:** ![seraphangel](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/seraphangel/32/2354_2.png) [@seraphangel](https://forum.kirupa.com/u/seraphangel)\
**Post date:** [April 14, 2006, 2:19pm UTC](https://forum.kirupa.com/t/multiple-slideshows/185416/8 "2006-04-14T14:19:52Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![scotty](https://avatars.discourse-cdn.com/v4/letter/s/91b2a8/32.png) [@scotty](https://forum.kirupa.com/u/scotty)\
**Post date:** [April 15, 2006, 8:11am UTC](https://forum.kirupa.com/t/multiple-slideshows/185416/9 "2006-04-15T08:11:59Z")

</div>

you’re welcome =)
