Slideshow Thumbnail Help

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.