Hello! I'm completely stumped. I have an XML image gallery that's loading
thumbnails in the wrong order half the time. When I view the movie in my
computer all works fine. I even trace the the xml array and all is in the
correct order. But when I view in in the browser from the remote server, half
the time my thumbnails are in the wrong order. What's even stranger is that my
the thumbnail mc's are linking to the correct videos for that position, even if
the thumbnail is not in the correct position. Very strange behavior for flash.
Any help would be highly appreciated.
Thanks!
// displays thumbnails and positions the thumbnails
function thumbDisplay(arrayN) {
//tArray[arrayN].reverse();
var newX:Number = 0;
var nodeConversion:Number = 0;
var depth:Number=0;
var i:Number = 0;
thumbXY();
//removeMC();
for (var k = 0; k<displayLimit; k++) {
trace(tArray[arrayN][k]);
thumbnail_mc.createEmptyMovieClip("t"+k, k);
tlistener = new Object();
image_mcl = new MovieClipLoader();
image_mcl.addListener(tlistener);
image_mcl.loadClip("clips/thumb/"+selectedGallery+"/"+tArray[arrayN][k]+".jpg"
, "thumbnail_mc.t"+k);
tlistener.onLoadStart = function(target_mc) {
target_mc._x = _global.thisX;
target_mc._y = _global.thisY;
// if you've displayed 3 columns of images, start a new row.
if ((i+1)%3 == 0) {
// reset the X and Y positions
_global.thisX = 0;
_global.thisY += 67+16;
} else {
_global.thisX += 100+16;
};
target_mc.id = (arrayN*displayLimit+i);
target_mc.onRelease = function() {
loadSelectedClip(this.id);
};
target_mc.onRollOver = function() {
this._alpha = 50;
//trace(this.id);
};
target_mc.onRollOut = function() {
this._alpha = 100;
};
i++;
};
};
};
BWolfe [ADOBE] - 31 Oct 2008 21:15 GMT
I just worked on something very similar.. What I'd do is add a debug text field
to the stage (or two) and start dumping variables into those fields so you can
get a live trace of what's in the array and what's in k. Check those first,
make sure they're showing what you expect to see from the XML.
Also, when you're creating your empty container clips, consider using
getNextHighestDepth() instead of the variable k.