Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion GroupsGeneralPHPASPPerlColdFusionFlashHTML, CSS, ScriptsBrowsers

Webmaster Forum / Flash / General Flash Topics / October 2008



Tip: Looking for answers? Try searching our database.

XML thumbnails loading in wrong order

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
crisbosch - 31 Oct 2008 15:43 GMT
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.
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.