# Slideshow Thumbnail Help

**URL:** <https://forum.kirupa.com/t/slideshow-thumbnail-help/250586>\
**Category:** flash\
**Created:** [January 30, 2008, 7:06pm UTC](https://forum.kirupa.com/t/slideshow-thumbnail-help/250586 "2008-01-30T19:06:44Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![uNxdefined](https://avatars.discourse-cdn.com/v4/letter/u/ac91a4/32.png) [@uNxdefined](https://forum.kirupa.com/u/uNxdefined)\
**Post date:** [January 30, 2008, 7:06pm UTC](https://forum.kirupa.com/t/slideshow-thumbnail-help/250586/1 "2008-01-30T19:06:44Z")

</div>

Hey guys I need help agian. I’m trying to create a slideshow with thumbnails and i have a code that makes the thumbnails popup. I can’t figure out two things though. If there is no thumbnail it will just show a black space obviously according to my code and I’m trying to make it when you click the thumbnail the big picture changes to that.

Why doesn’t thumb = thumb.nextSibling; work!?

Here’s my code.

stop();  
slides\_xml = new XML();  
slides\_xml.onLoad = startSlideShow;  
slides\_xml.load(“slides.xml”);  
slides\_xml.ignoreWhite = true;  
//  
// Show the first slide and intialize variables  
function startSlideShow(success) {  
if (success == true) {  
rootNode = slides\_xml.firstChild;  
totalSlides = rootNode.childNodes.length;  
firstSlideNode = rootNode.firstChild;  
currentSlideNode = firstSlideNode;  
currentIndex = 1;  
updateSlide(firstSlideNode);  
}  
}  
//  
// Updates the current slide with new image and text  
// Updates the current slide with new image and text  
function updateSlide(newSlideNode) {  
imagePath = newSlideNode.attributes.jpegURL;  
thumb = newSlideNode.attributes.thumb;  
thumb2 = newSlideNode.nextSibling.attributes.thumb;  
thumb3 = newSlideNode.nextSibling.nextSibling.attributes.thumb;  
thumb4 = newSlideNode.nextSibling.nextSibling.nextSibling.attributes.thumb;  
thumb5 = newSlideNode.nextSibling.nextSibling.nextSibling.nextSibling.attributes.thumb;  
thumb6 = newSlideNode.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling.attributes.thumb;  
thumb7 = newSlideNode.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling.nextSibling.attributes.thumb;  
var loader:MovieClipLoader = new MovieClipLoader();  
loader.addListener(loader\_listener);  
loader.loadClip(imagePath, targetClip);  
var tloader:MovieClipLoader = new MovieClipLoader();  
tloader.addListener(tloader\_listener);  
tloader.loadClip(thumb, thumb\_mc);  
var ttloader:MovieClipLoader = new MovieClipLoader();  
ttloader.addListener(ttloader\_listener);  
ttloader.loadClip(thumb2, thumb2\_mc);  
var t3loader:MovieClipLoader = new MovieClipLoader();  
t3loader.addListener(t3loader\_listener);  
t3loader.loadClip(thumb3, thumb3\_mc);  
var t4loader:MovieClipLoader = new MovieClipLoader();  
t4loader.addListener(t4loader\_listener);  
t4loader.loadClip(thumb4, thumb4\_mc);  
var t5loader:MovieClipLoader = new MovieClipLoader();  
t5loader.addListener(t5loader\_listener);  
t5loader.loadClip(thumb5, thumb5\_mc);  
var t6loader:MovieClipLoader = new MovieClipLoader();  
t6loader.addListener(t6loader\_listener);  
t6loader.loadClip(thumb6, thumb6\_mc);  
var t7loader:MovieClipLoader = new MovieClipLoader();  
t7loader.addListener(t7loader\_listener);  
t7loader.loadClip(thumb7, thumb7\_mc);  
}  
var tloader\_listener:Object = new Object();  
tloader\_listener.onLoadInit = function(ttarget\_mc:MovieClip):Void  
{  
var tmax\_width = 35;  
var tmax\_height = 35;  
ttarget\_mc.\_xscale = 35;  
ttarget\_mc.\_yscale = 35;  
if(ttarget\_mc.\_width\>tmax\_width)  
{  
ttarget\_mc.\_width = tmax\_width;  
}  
if(ttarget\_mc.\_height\>tmax\_height)  
{  
ttarget\_mc.\_height = tmax\_height;  
}  
// center clip (rounded to nearest pixel to keep things sharp)  
ttarget\_mc.\_x = 0;  
ttarget\_mc.\_y = 268;  
};  
///////////////////////////////////////////////////////////////////////////////

var ttloader\_listener:Object = new Object();  
ttloader\_listener.onLoadInit = function(tttarget\_mc:MovieClip):Void  
{  
var tmax\_width = 35;  
var tmax\_height = 35;  
tttarget\_mc.\_xscale = 35;  
tttarget\_mc.\_yscale = 35;  
if(tttarget\_mc.\_width\>tmax\_width)  
{  
tttarget\_mc.\_width = tmax\_width;  
}  
if(tttarget\_mc.\_height\>tmax\_height)  
{  
tttarget\_mc.\_height = tmax\_height;  
}  
// center clip (rounded to nearest pixel to keep things sharp)  
tttarget\_mc.\_x = 35;  
tttarget\_mc.\_y = 268;  
};  
var t3loader\_listener:Object = new Object();  
t3loader\_listener.onLoadInit = function(t3target\_mc:MovieClip):Void  
{  
var tmax\_width = 35;  
var tmax\_height = 35;  
t3target\_mc.\_xscale = 35;  
t3target\_mc.\_yscale = 35;  
if(t3target\_mc.\_width\>tmax\_width)  
{  
t3target\_mc.\_width = tmax\_width;  
}  
if(t3target\_mc.\_height\>tmax\_height)  
{  
t3target\_mc.\_height = tmax\_height;  
}  
// center clip (rounded to nearest pixel to keep things sharp)  
t3target\_mc.\_x = 71;  
t3target\_mc.\_y = 268;  
};  
var t4loader\_listener:Object = new Object();  
t4loader\_listener.onLoadInit = function(t4target\_mc:MovieClip):Void  
{  
var tmax\_width = 35;  
var tmax\_height = 35;  
t4target\_mc.\_xscale = 35;  
t4target\_mc.\_yscale = 35;  
if(t4target\_mc.\_width\>tmax\_width)  
{  
t4target\_mc.\_width = tmax\_width;  
}  
if(t4target\_mc.\_height\>tmax\_height)  
{  
t4target\_mc.\_height = tmax\_height;  
}  
// center clip (rounded to nearest pixel to keep things sharp)  
t4target\_mc.\_x = 106;  
t4target\_mc.\_y = 268;  
};  
var t5loader\_listener:Object = new Object();  
t5loader\_listener.onLoadInit = function(t5target\_mc:MovieClip):Void  
{  
var tmax\_width = 35;  
var tmax\_height = 35;  
t5target\_mc.\_xscale = 35;  
t5target\_mc.\_yscale = 35;  
if(t5target\_mc.\_width\>tmax\_width)  
{  
t5target\_mc.\_width = tmax\_width;  
}  
if(t5target\_mc.\_height\>tmax\_height)  
{  
t5target\_mc.\_height = tmax\_height;  
}  
// center clip (rounded to nearest pixel to keep things sharp)  
t5target\_mc.\_x = 141;  
t5target\_mc.\_y = 268;  
};  
var t6loader\_listener:Object = new Object();  
t6loader\_listener.onLoadInit = function(t6target\_mc:MovieClip):Void  
{  
var tmax\_width = 35;  
var tmax\_height = 35;  
t6target\_mc.\_xscale = 35;  
t6target\_mc.\_yscale = 35;  
if(t6target\_mc.\_width\>tmax\_width)  
{  
t6target\_mc.\_width = tmax\_width;  
}  
if(t6target\_mc.\_height\>tmax\_height)  
{  
t6target\_mc.\_height = tmax\_height;  
}  
// center clip (rounded to nearest pixel to keep things sharp)  
t6target\_mc.\_x = 177;  
t6target\_mc.\_y = 268;  
};  
var t7loader\_listener:Object = new Object();  
t7loader\_listener.onLoadInit = function(t7target\_mc:MovieClip):Void  
{  
var tmax\_width = 35;  
var tmax\_height = 35;  
t7target\_mc.\_xscale = 35;  
t7target\_mc.\_yscale = 35;  
if(t7target\_mc.\_width\>tmax\_width)  
{  
t7target\_mc.\_width = tmax\_width;  
}  
if(t7target\_mc.\_height\>tmax\_height)  
{  
t7target\_mc.\_height = tmax\_height;  
}  
// center clip (rounded to nearest pixel to keep things sharp)  
t7target\_mc.\_x = 212;  
t7target\_mc.\_y = 268;  
};  
////////////////////////////////////////////////////////////////////////////////  
//new loader  
var loader\_listener:Object = new Object();  
loader\_listener.onLoadInit = function(target\_mc:MovieClip):Void  
{  
// targetclip max width and height parameters  
var max\_width = 220;  
var max\_height = 220;

if(target\_mc.\_width \>max\_width)  
{  
target\_mc.\_width = max\_width;  
target\_mc.\_yscale = target\_mc.\_xscale;  
}  
// if height is too much then resize to fit height  
if(target\_mc.\_height\>max\_height)  
{  
target\_mc.\_height = max\_height;  
target\_mc.\_xscale = target\_mc.\_yscale;  
}  
// center clip (rounded to nearest pixel to keep things sharp)  
target\_mc.\_x = Math.round(Stage.width - target\_mc.\_width)/2;  
target\_mc.\_y = Math.round(Stage.height - target\_mc.\_height)/2 - 20;  
};

//  
// Event handler for ‘Next slide’ button  
next\_btn.onRelease = function() {  
fade.play();  
nextSlideNode = currentSlideNode.nextSibling;

if (nextSlideNode == null) {  
break;  
} else {  
currentIndex++;  
updateSlide(nextSlideNode);  
currentSlideNode = nextSlideNode;

}  
};  
//  
// Event handler for ‘Previous slide’ button  
back\_btn.onRelease = function() {  
fade.play();  
previousSlideNode = currentSlideNode.previousSibling;  
if (previousSlideNode == null) {  
break;  
} else {  
currentIndex–;  
currentSlideNode = previousSlideNode;  
updateSlide(previousSlideNode);  
}  
};  
thumb\_btn.onRelease = function() {  
nextSlideNode = currentSlideNode.nextSibling;

if (nextSlideNode == null) {  
break;  
} else {  
currentIndex++;  
updateSlide(nextSlideNode);  
currentSlideNode = nextSlideNode;  
}

};

And my xml

\<Slides\>

\<slideNode jpegURL=“back2.jpg” thumb=“barron.jpg”\>barron\</slideNode\>  
\<slideNode jpegURL=“backround.jpg” thumb =“back2.jpg”\>barron\</slideNode\>

\</slides\>

Not posting FLA atm b/c I don’t think it’s needed to tell me where my flaw in code is :crying:

Plz help.
