All that's needed is for one viewer.swf that can accept a path to the gallery.xml it should be using.
This would make multiple galleries very simple.
It's fairly simple to set up, and really flexible. Here's how I did it:
In my main swf, I have a placeholder movieclip that I load my content swfs into. In the content swfs that contain galleries, I have another placeholder that I load viewer.swf into.
I load an initial gallery and then have a dropdown list that users can use to switch galleries. To load the initial gallery and xml file, I put an action in the first frame of the content swf:
_root._root.xmlDataPath = "(path to xml file)";
this.(placeholder movieclip).loadMovie("viewer.swf");
(Obviously you may have to change the paths to _root and viewer.swf depending on your site structure.)
Then you just need to define a function that will reload viewer.swf and overwrite the path to the root xml file on a button press or dropdown list change or what have you. So, in a simple example, you do something like this in your AS frame:
function gallerySwap(){
this.(placeholder movieclip).loadMovie("viewer.swf");
and then on your buttons:
on (press){
gallerySwap();
_root._root.xmlDataPath = "(path to new xml file");
}
Voila, when your user presses the button the viewer.swf will reload using the new xml file.
Note that your viewer.fla file needs to have the following code for this work; it should be in there already (layer 2, frame 15, line 5 in mine):
//get external XML dataPath
if (_root.xmlDataPath == undefined){
gXmlDataPath = "imageData.xml"
}else{
gXmlDataPath = _root.xmlDataPath;
}
(I think you need your viewer.swf in the same folder as your main swf for this to work, or you'll need to modify the _root path in the example above; mine are in the same folder so I didn't have to worry about it.)