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.