7 Replies Latest reply on Aug 8, 2007 12:11 AM by Greg Dove

    really confusing activity...

    DZ-015 Level 1
      Hey everyone,

      Take a look at this page --> www.ambientdesignstlouis.com/interior.html

      When you first load it, the thumbnail images will be positioned wrong. When you reload it, they will correct themselves. This happens for each page - Interior, Exterior and Corporate. Each time you go to a page for the first time, it loads screwy. The second time, it's all better. The screwy activity starts over if you clear your browser's cache to.

      I'm really confused. Any ideas why this is happening / how to prevent if from happening?

      FYI - the swf loads an xml file with the thumbnail paths in it, then parces the file and finally loads the thumbnails from a gallery folder. I'm inclined to think this is related.... but even still, it's confusing, because all pages load the same xml file - so once the problem has corrected itself on one page why not on the others too?

      Oh well. Toss me your feedback. Thanks!
        • 1. really confusing activity...
          Greg Dove Level 4
          Hmmm. I wasn't getting any actual image thumbnails.. just red, green and blue placeholders (I presume these will be replaced by thumbnails of images? EDIT: oops I wasn't paying attention - I just checked and they're different - sorry). And I didn't seem to notice a difference in behaviour... it was - as you say - screwy.

          But fixable!
          At this stage I'll assume that your thumbnails are the red, green and blue images.
          So my guess is that its related to timing and not waiting for your image to be loaded into the holder clip before you attempt to place it....this would account for your different experience from the cache copy - it loads faster (but not for me). The onLoadInit handler for a MovieClipLoader listener will allow you to do this. If you're not using MovieClipLoader (e.g. if you're using LoadMovie to load the images) then I recommend changing (its possible to do it with LoadMovie, but I MovieClipLoader is easier/better IMHO).

          Post your relevant code (please use the attach code button to do so) if you want me to take a look at it.


          • 2. Re: really confusing activity...
            DZ-015 Level 1
            Hey - here's the code that loads the thumbnail images....

            • 3. Re: really confusing activity...
              Greg Dove Level 4
              So does

              _TSU.thumbLoaded(mcThumb) do the placement?

              Can you post the code for that?





              • 4. Re: really confusing activity...
                DZ-015 Level 1
                If you want I can post the functions.... thumbLoaded is relatively short - it just populates some variables and calles updateStack... which is about three pages long. updateStack is what places the thumbs.

                It never hickups when I run it on my computer. I think it has to be a situation of race conditions... thumbs loading simultaneously and such... any thoughts?
                • 5. really confusing activity...
                  Greg Dove Level 4
                  I don't think we need the three pages of code.

                  Just the part where you're placing them: how its triggered (does it come from onLoadInit, for example,) and/or tracked so you know which ones are being placed or if order is not important, just how the positioning of each clip as it loads is being managed.

                  The load order from MovieClipLoader is unpredictable so you can't rely on the order in which the loadClip commands were executed to be the order of the actual loading.

                  Also I wasn't clear on one thing... is it the 'thumbs' in the header or the body or both that are not ending up where they should?

                  • 6. Re: really confusing activity...
                    DZ-015 Level 1
                    it's in the header... though on the gallery page the same problem is happening.

                    How the application works is it loads an XML file with thumb addresses. As thumbs load, it records the size and position of all of them, and then (according to where the mouse is, among other things) sends commands to update all positions. So any time there is a change (ie, the mouse moving over a thumbnail image) it modifies the variables that tell the thumbnail where it should go and what size it should be, then updates the stack of thumbnails according to those variables.

                    The loading portion works by the same system, except that the thumbnails which aren't loaded yet are ignored... I guess this could throw something off... but I'm not sure how.

                    Possible solutions... double check the position after the first move? Stagger the load commands by 5 frames?
                    • 7. Re: really confusing activity...
                      Greg Dove Level 4
                      it's in the header... though on the gallery page the same problem is happening.

                      >OK. thanks for clarifying that.

                      How the application works is it loads an XML file with thumb addresses. As thumbs load, it records the size and position of all of them, and then (according to where the mouse is, among other things) sends commands to update all positions.

                      >OK. Well the size is only available for a loaded image (for certain) after the onLoadInit has occured. You can position it before then, but if you're using size to check things in order to position it, you need to make sure its happening after the MovieClipLoader's onLoadInit.

                      So any time there is a change (ie, the mouse moving over a thumbnail image) it modifies the variables that tell the thumbnail where it should go and what size it should be, then updates the stack of thumbnails according to those variables.

                      >All I observed was a scale tween on mouseover in the header.

                      The loading portion works by the same system, except that the thumbnails which aren't loaded yet are ignored... I guess this could throw something off... but I'm not sure how.

                      >OK but bear in mind my earlier comment that the order that the thumbs load in is not necessarily the order that _TSU.thumbLoading(i); recieves. It may be in the correct order on second and subsequent attempts if its just loading from the browser cache... do you think that might be the issue?

                      Possible solutions... double check the position after the first move? Stagger the load commands by 5 frames?

                      >Its difficult for me to suggest anything without seeing the code that is relevant to placement. If the issue is related to load order, then either force them to load in order or check their intended order in the placement code via the suffix in the movieclip names (the i part of 'thumb'+i);