Topic: multiple galleries - xml-loading problem

Hi everybody,

I'm running a website with multiple galleries. The code I use is adopted from the multiple galleries example. But the website shows an odd behaviour:
The xml-files loaded are always one step behind, and sometimes they do not show up at all without the error message: gallery not found.
Website: http://www.antsandfriends.com


Here's the source code:

stop();


//init stage
Stage.align = "TL"; 
Stage.scaleMode = "noScale";

//set width and height of SimpleViewer swf
_global.SVStageWidth = 720;
_global.SVStageHeight = 435;

var galleryID:String;
var mLoader_mcl = new MovieClipLoader();
mLoader_mcl.addListener(this);

function loadGal(galId){
    galleryID = galId;    
    mLoader_mcl.loadClip("viewer.swf",mcLoader);

// adding a scrollbar depending on the gallery    
    if( galleryID == "firma" || galleryID == "news" || galleryID == "textil" || galleryID == "referenzen" || galleryID == "anfahrt" || galleryID == "impressum" || galleryID == "full") {
_root.attachMovie("scroller", "scroller", 1, {_x:875, _y:260});
        }
    else {
        _root.scroller.unloadMovie();
    }
}


function onLoadInit(){
    
    //set gallery xml name
    _root.xmlDataPath = "xml/"+galleryID + ".xml";
    //set gallery specific options
    if (galleryID == "full" || galleryID == "jobs"){            
    com.airtightinteractive.apps.viewers.simpleViewer.Options.imageAreaWidth = 380; //width of Image Area 
     com.airtightinteractive.apps.viewers.simpleViewer.Options.captionX = 410; //X posn of Title text
    com.airtightinteractive.apps.viewers.simpleViewer.Options.captionY = 20; ///Y posn of Title text
    com.airtightinteractive.apps.viewers.simpleViewer.Options.captionWidth = 280; //width of Title text
    com.airtightinteractive.apps.viewers.simpleViewer.Options.captionHeight = 560; //height of Title text    
    
    }else if (galleryID == "team") {
    com.airtightinteractive.apps.viewers.simpleViewer.Options.imageAreaWidth = 380; //width of Image Area 
     com.airtightinteractive.apps.viewers.simpleViewer.Options.captionX = 410; //X posn of Title text
    com.airtightinteractive.apps.viewers.simpleViewer.Options.captionY = 170; ///Y posn of Title text
    com.airtightinteractive.apps.viewers.simpleViewer.Options.captionWidth = 280; //width of Title text
    com.airtightinteractive.apps.viewers.simpleViewer.Options.captionHeight = 250; //height of Title text    
    com.airtightinteractive.apps.viewers.simpleViewer.Options.thumbnailColumns = 5; // Anzahl der Thumbnails
    com.airtightinteractive.apps.viewers.simpleViewer.Options.nextThumbArrowX = 250; // Pos next Arrow    
      
    }else if (galleryID == "news" || galleryID == "vip") {
    com.airtightinteractive.apps.viewers.simpleViewer.Options.imageAreaWidth = 450; //width of Image Area 
     com.airtightinteractive.apps.viewers.simpleViewer.Options.captionX = 480; //X posn of Title text
    com.airtightinteractive.apps.viewers.simpleViewer.Options.captionY = 20; ///Y posn of Title text
    com.airtightinteractive.apps.viewers.simpleViewer.Options.captionWidth = 220; //width of Title text
    com.airtightinteractive.apps.viewers.simpleViewer.Options.captionHeight = 450; //height of Title text
    com.airtightinteractive.apps.viewers.simpleViewer.Options.thumbnailColumns = 6; // Anzahl der Thumbnails
    com.airtightinteractive.apps.viewers.simpleViewer.Options.nextThumbArrowX = 310; // Pos next Arrow        
     
    } else if (galleryID == "showroom" || galleryID == "gadgets" || galleryID == "onpacks" || galleryID == "textil" || galleryID == "shops" ){            
    com.airtightinteractive.apps.viewers.simpleViewer.Options.imageAreaWidth = 480; //width of Image Area 
     com.airtightinteractive.apps.viewers.simpleViewer.Options.captionX = 500; //X posn of Title text
    com.airtightinteractive.apps.viewers.simpleViewer.Options.captionY = 20; ///Y posn of Title text
    com.airtightinteractive.apps.viewers.simpleViewer.Options.captionWidth = 190; //width of Title text
    com.airtightinteractive.apps.viewers.simpleViewer.Options.captionHeight = 560; //height of Title text    
    com.airtightinteractive.apps.viewers.simpleViewer.Options.thumbnailColumns = 7; // Anzahl der Thumbnails
    com.airtightinteractive.apps.viewers.simpleViewer.Options.nextThumbArrowX = 360; // Pos next Arrow
    
    } else if(galleryID == "impressum") {
    com.airtightinteractive.apps.viewers.simpleViewer.Options.imageAreaWidth = 380; //width of Image Area 
     com.airtightinteractive.apps.viewers.simpleViewer.Options.captionX = 405; //X posn of Title text
    com.airtightinteractive.apps.viewers.simpleViewer.Options.captionY = 15; ///Y posn of Title text
    com.airtightinteractive.apps.viewers.simpleViewer.Options.captionWidth = 290; //width of Title text
    com.airtightinteractive.apps.viewers.simpleViewer.Options.captionHeight = 820; //height of Title text    
    com.airtightinteractive.apps.viewers.simpleViewer.Options.thumbnailColumns = 5; // Anzahl der Thumbnails
    com.airtightinteractive.apps.viewers.simpleViewer.Options.nextThumbArrowX = 250; // Pos next Arrow    
    } else {
    com.airtightinteractive.apps.viewers.simpleViewer.Options.imageAreaWidth = 380; //width of Image Area 
     com.airtightinteractive.apps.viewers.simpleViewer.Options.captionX = 405; //X posn of Title text
    com.airtightinteractive.apps.viewers.simpleViewer.Options.captionY = 15; ///Y posn of Title text
    com.airtightinteractive.apps.viewers.simpleViewer.Options.captionWidth = 290; //width of Title text
    com.airtightinteractive.apps.viewers.simpleViewer.Options.captionHeight = 760; //height of Title text    
    com.airtightinteractive.apps.viewers.simpleViewer.Options.thumbnailColumns = 5; // Anzahl der Thumbnails
    com.airtightinteractive.apps.viewers.simpleViewer.Options.nextThumbArrowX = 250; // Pos next Arrow
    }
}

The first gallery is loaded with a button.
When I test the swf locally everything works fine. But online I have a mess.
Any idea?
Thanx for your help.

Re: multiple galleries - xml-loading problem

Seems to be working now?

Felix Turner
SimpleViewer Support Team.

Re: multiple galleries - xml-loading problem

Hi Felix,

thanx for your reply.
It made me realize that I only tested the website in Firefox 3 on my desktop computer.

Now I have tested the website in IE6, IE7, Opera 9.x and Safari. And in all these browsers everything works like it should.

But in Firefox 3 on my computer the galleryID and so the xml-file is always one step behind.
Now I had a look with Firefox 3 on my laptop and, strange enough, everything's fine.

Do you have any explanation for this mystery?
I mean, since this bug seems to only occur on my computer I do not worry about it any more, but I am quite curious.

Re: multiple galleries - xml-loading problem

Did you clear your cache?

Felix Turner
SimpleViewer Support Team.

Re: multiple galleries - xml-loading problem

Yes, I cleared the cache.
Maybe I have to reinstall the flashplayer.