StreetracerX
July 22nd, 2003, 11:14 AM
Basically I'm trying to build an image gallery that will display 9 thumbnails & clicking on a thumbnail has to load a larger version of that image & some text into a display holding area. I have gotten it so it appears as a slideshow (which is useless to me but gave me a good starting point to test the XML infeed - which works on that baisis) & am trying to build the individual thumbnail click functions & having no luck whatsoever. I've also been trying to pre-populate the thumbnails from the XML feed using a variable called imagePaths but I can't even get them to preload - all I get are greyed thumbholders that when I click on them clear the display areas from the slideshow function. I have a fried head at this stage & am looking for any advice or tips that can help point me in the right direction. This is what I built so far....
slides_xml = new XML();
slides_xml.onLoad = startSlideShow;
slides_xml.load("pictures.xml");
slides_xml.ignoreWhite = true;
function startSlideShow(success) {
if (success == true) {
rootNode = slides_xml.firstChild;
totalSlides = rootNode.childNodes.length; firstSlideNode = rootNode.firstChild; currentSlideNode = firstSlideNode; currentIndex = 1;
updateSlide(firstSlideNode);
}
}
//
function updateSlide(newSlideNode) { imagePaths = newSlideNode.attributes.jpegURLs;
imagePathl = newSlideNode.attributes.jpegURLl;
slideText = newSlideNode.firstChild.nodeValue;
loadMovie(imagePathl, targetClip); loadMovie(imagePaths, thumbClip);
}
//
next_btn.onRelease = function() { nextSlideNode = currentSlideNode.nextSibling;
if (nextSlideNode == null) {
break;
} else {
currentIndex++;
element 'currentIndex'
updateSlide(nextSlideNode);
currentSlideNode = nextSlideNode;
}
};
//
back_btn.onRelease = function() { previousSlideNode = currentSlideNode.previousSibling;
if (previousSlideNode == null) {
break;
} else {
currentIndex--;
currentSlideNode = previousSlideNode;
updateSlide(previousSlideNode);
}
};
//
// Event handler for 'Thumbnail Selector slide' button
story_btn1.onRelease = function(){
imagePathl = newSlideNode[0].attributes.jpegURLl; //index into slideNode array to [0] to set array access point
slideText = newSlideNode[0].attributes.nodeValue; //takes text from image tag in xml sheet defintion into container 'slideText' from array element [0]
slideText = eval (newSlideNode[0].attributes.nodeValue);
loadMovie(imagePathl, targetClip); //loads large picture from array access point above into container 'targetClip'
}
//
I've used some basics from a Macromedia Slideshow tutorial for this & basically have been using Flash for 4 days now & have used Director before with some intermediate lingo which has given me some idea as to what is going on - but I could really do with another pair of eyes or someone else grey matter who understands this better to even give me a hint or point me in the right direction on something to read to help me here
In advance - I am much obliged to anyone who reads this or takes the time to give me any assistance or advice... I'm fairly new to action scripting & Colin Moock's book has been a great help thus far - but I can't seem to get my head around this?? Any ideas?? Anyone???
slides_xml = new XML();
slides_xml.onLoad = startSlideShow;
slides_xml.load("pictures.xml");
slides_xml.ignoreWhite = true;
function startSlideShow(success) {
if (success == true) {
rootNode = slides_xml.firstChild;
totalSlides = rootNode.childNodes.length; firstSlideNode = rootNode.firstChild; currentSlideNode = firstSlideNode; currentIndex = 1;
updateSlide(firstSlideNode);
}
}
//
function updateSlide(newSlideNode) { imagePaths = newSlideNode.attributes.jpegURLs;
imagePathl = newSlideNode.attributes.jpegURLl;
slideText = newSlideNode.firstChild.nodeValue;
loadMovie(imagePathl, targetClip); loadMovie(imagePaths, thumbClip);
}
//
next_btn.onRelease = function() { nextSlideNode = currentSlideNode.nextSibling;
if (nextSlideNode == null) {
break;
} else {
currentIndex++;
element 'currentIndex'
updateSlide(nextSlideNode);
currentSlideNode = nextSlideNode;
}
};
//
back_btn.onRelease = function() { previousSlideNode = currentSlideNode.previousSibling;
if (previousSlideNode == null) {
break;
} else {
currentIndex--;
currentSlideNode = previousSlideNode;
updateSlide(previousSlideNode);
}
};
//
// Event handler for 'Thumbnail Selector slide' button
story_btn1.onRelease = function(){
imagePathl = newSlideNode[0].attributes.jpegURLl; //index into slideNode array to [0] to set array access point
slideText = newSlideNode[0].attributes.nodeValue; //takes text from image tag in xml sheet defintion into container 'slideText' from array element [0]
slideText = eval (newSlideNode[0].attributes.nodeValue);
loadMovie(imagePathl, targetClip); //loads large picture from array access point above into container 'targetClip'
}
//
I've used some basics from a Macromedia Slideshow tutorial for this & basically have been using Flash for 4 days now & have used Director before with some intermediate lingo which has given me some idea as to what is going on - but I could really do with another pair of eyes or someone else grey matter who understands this better to even give me a hint or point me in the right direction on something to read to help me here
In advance - I am much obliged to anyone who reads this or takes the time to give me any assistance or advice... I'm fairly new to action scripting & Colin Moock's book has been a great help thus far - but I can't seem to get my head around this?? Any ideas?? Anyone???