PDA

View Full Version : Image slideshow and scenes



leofish
April 5th, 2007, 08:34 PM
I'm trying to have a multi-scene project with a image slideshow on the first one, and once all the images have been show I want it to progress to the next. I'm using a simplified version the xml slideshow tutorial on here. I would just extend the timeline out to the needed frames ( total pics x delay x fps) but there are over 250 pictures which would result in some 60,000 frames. I know there has got to be a way to keep flash on the slideshow scene for the required time.. I was thinking something with setInterval, but I have no idea where to go with it. here is my code, any help would be greatly appreciated :X

delay = 5000;
// total frames = (number of pictures)(time up)(fps)
//-----------------------
function loadXML(loaded) {

if (loaded) {

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

image[i] = xmlNode.childNodes[i].childNodes[0].firstChild.nodeValue;
description[i] = xmlNode.childNodes[i].childNodes[1].firstChild.nodeValue;

}
firstImage();

} else {

content = "file not loaded!";

}

}
xmlData = new XML();
xmlData.ignoreWhite = true;
xmlData.onLoad = loadXML;
xmlData.load("images.xml");
/////////////////////////////////////

p = 0;

function nextImage() {

if (p<(total-1)) {

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

imgloader.contentPath= image[p];
picture_num();
slideshow();

}

}

}
function firstImage() {

if (loaded == filesize) {

imgloader.contentPath= image[0];
picture_num();
slideshow();

}

}
function picture_num() {

current_pos = p+1;
pos_txt.text = current_pos+" / "+total;

}
function slideshow() {

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

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

p = 0;
firstImage();

} else {

nextImage();

}

}

}

rabidGadfly
April 5th, 2007, 09:45 PM
You could load the XML for each slideshow into separate arrays. Each array would contain the references to a separate slideshow. Then you can make an array of your slideshow arrays and loop through it, clearing out and restarting your slideshow each time one ends. It would take some work but you wouldn't need separate scenes for each slideshow.

leofish
April 5th, 2007, 11:14 PM
oops, guess I didnt mention anything about the next scene, after the slideshow.. the next scene is a video with credits scrolling by, so it's not a problem of multiple picture sets, just being able to stay in the slideshow scene until all the photos have appeared

leofish
April 9th, 2007, 08:04 PM
bump? :X