I have a small gallery that loads thumbnails and the links they represent from an xml file. When I test it gallery on my computer everything works fine. However, when I simulate a download or when I upload to an actual site things start going wrong.
Most of the code is borrowed from this tutorial (which by the way was very helpful ) :
http://www.kirupa.com/developer/flash8/best_structure_flash_site.htm
I modified what i needed too and reused the rest. Everything works fine except for that the load order of the thumbnails is reversed. I haven’t really changed any part of the code that would cause this, or at least I don’t think I have.
The real problem, however, is that when i simulate a downloaded version or when upload them to my test site, the position of the thumbnails are swapped. A thumbnail i expected to load in a certain place and order has now taken the place of another one. When clicking a thumbnail it displays the picture of the thumbnail that should actually have been there, so the links still load in the correct order.
When i change the simulated bandwidth while testing the movie, the position alter. At one bandwidth they show up in a certain order and when then trying out another bandwidth the order changes.
Now, my question is: What the hell is going on?
The XML load function:
[FONT=Courier New]function loadXML(loaded) {
if (loaded) {
var xnRootNode:XMLNode = this;
//trace( xnRootNode );
// number of buttons
nTotalButtons = xnRootNode.firstChild.childNodes.length;
// fill arrays
for (var i = 0; i<nTotalButtons; i++) {
thumbImages.push(xnRootNode.firstChild.childNodes*.childNodes[0].firstChild.nodeValue);
thumbLinks.push(xnRootNode.firstChild.childNodes*.childNodes[1].firstChild.nodeValue);
}
// everthing is loaded; we can move on
gotoAndStop(3);
}
}[/FONT]
No problem there right?
Here’s the where the thumbs are loaded:
[FONT=Courier New]for (var i = 0; i<nTotalButtons; i++) {
thumb_holder.createEmptyMovieClip( "thumbButton"+i, i );
// make new MovieClip and set to newly created button
var thumbButton:MovieClip = thumb_holder["thumbButton"+i];
// load images
var backwardsCount:Number = nTotalButtons - 1 - i;
image_mcl.loadClip( thumbImages[backwardsCount], thumbButton );
}
// Invoked when the actions on the first frame of the loaded clip have been executed
mclListener.onLoadInit = function(target_mc:MovieClip) {
// add link property
target_mc.linkURL = thumbLinks[nCounter];
target_mc._alpha = alpha;
// add events
target_mc.onPress = buttonClick;
.
.
.
nCounter += 1;
};
image_mcl.addListener(mclListener);
// Event handlers
function buttonClick():Void {
pic_holder.loadMovie(this.linkURL);
}[/FONT]
Any and all help is welcome.