I am trying to have a gallery via xml (this is the easy part) it works great, my problem is that I am trying to get two movie clips on the same stage play the same xml info but at different times. here is the stage (images1 and images2 are the movie clips:
Now so far I have a XML file in place that places just fine in images1 movie clip. But I need to figure out how to play them in the images2 movie clip. here is the xml data:
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<images>
<pic>
<image>1.jpg</image>
</pic>
<pic>
<image>2.jpg</image>
</pic>
<pic>
<image>3.jpg</image>
</pic>
<pic>
<image>4.jpg</image>
</pic>
<pic>
<image>5.jpg</image>
</pic>
<pic>
<image>6.jpg</image>
</pic>
<pic>
<image>7.jpg</image>
</pic>
<pic>
<image>8.jpg</image>
</pic>
<pic>
<image>9.jpg</image>
</pic>
<pic>
<image>10.jpg</image>
</pic>
</images>
Here is the Actionscript code as well, I have tried multiple variants of the below to get it to play in the images2 movie clip and it will not play.
delay = 3000;
var preloadDelay_Frames = 12;
var frameCounter = 0;
//-----------------------
function loadXML(loaded) {
if (loaded) {
xmlNode = this.firstChild;
image = [];
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("images.xml");
/////////////////////////////////////
p = 0;
this.onEnterFrame = function() {
frameCounter++;
filesize = picture.getBytesTotal();
loaded = picture.getBytesLoaded();
if (loaded != filesize) {
if (frameCounter>preloadDelay_Frames) {
preloader._visible = true;
}
preloader.preload_bar._xscale = 100*loaded/filesize;
} else {
preloader._visible = false;
frameCounter = 0;
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);
slideshow();
}
}
}
function prevImage() {
if (p>0) {
p--;
picture._alpha = 0;
picture.loadMovie(image[p], 1);
}
}
function firstImage() {
if (loaded == filesize) {
picture._alpha = 0;
picture.loadMovie(image[0], 1);
slideshow();
}
}
function slideshow() {
myInterval = setInterval(pause_slideshow, delay);
function pause_slideshow() {
clearInterval(myInterval);
if (p == (total-1)) {
p = 0;
firstImage();
} else {
nextImage();
}
}
}
stop();
Also if anyone has any other code setup for this it should not be hard for me to change this over. thanks