Topic: Loading simpleviewer as an external swf


I have built a flash website where I am calling the simpleviewer gallery and loading it as an external swf into an exiting movie.

For one gallery I can do this, by having the gallery.xml in the root folder, but I want multiple galleries.

My file structure looks liike:

root: contains index.html and index.swf (master movie)
Gallery_1: contains simpleviewer.swf and gallery.xml for 1st gallery
Gallery_2: contains simpleviewer.swf and gallery.xml for 2nd gallery

My problem is that when I call the simpleviewer.swf movie, it loads fine but it is looking for the gallery.xml. I can't copy this into the root, because I need 2+ gallery.xmls, and one would overwrite the other!!!

Is there any way I can achieve this without having to use the source files???

Here's hoping you can help,
Michael H

Re: Loading simpleviewer as an external swf

You need to use the galleryURL parameter to tell the simpleviewer.swf which xml to load. Did you take a look at the flash embed example that comes with the SimpleViewer download?

Mike Richards
SimpleViewer Support Team.

Re: Loading simpleviewer as an external swf

Hi, thanks for the quick response.

I did look at the example, but couldn't work out how to get the script to work with my design.

My design has 2 gallery buttons that call an animation movie in the timeline i.e. click on motorsport button and that plays a fade and then loads the simpleviewer gallery movie, using AS3 to load the simpleviewer into the main stage.

I got it to work very nicely and also unload whenever a button on the nav bar is clicked. But of course the AS3 code does not point to the gallery.xml. and I get gallery.xml not found and no pictures :-)

How does galleryURL work???

If this is a bit outside of a support type question, I will understand. Love the product and will be more than happy to rework my design and just copy and paste the example code ito my reworked design.

Here's hoping you can help though :-)

Michael H

Re: Loading simpleviewer as an external swf

Please check the example code and FLA described here: … html#flash
The FLA shows you how to switch between galleries and how to set the gallery URL.

Felix Turner
SimpleViewer Support Team.

Re: Loading simpleviewer as an external swf


Thanks again for the quick response. Still can't get this to work. I am sure it is probably something simple I am missing :rolleyes:

If I copy the code directly, I get error on the API segment. I am using a fixed swf from svbuilder so don't need the API segment. My code looks like:

var svLoader:Loader = new Loader();
svLoader.contentLoaderInfo.addEventListener(Event.INIT, onViewerInit);
svLoader.load(new URLRequest("Gallery_1/simpleviewer.swf"));

function onViewerInit(e:Event):void{
var options:Object = Object(svLoader.content).embedOptions;
options.galleryURL = "Gallery_1/gallery.xml";

I get no errors until I load the gallery, then I get Gallery.XML not found again.

This is driving me mad!!! I am so close.

Can you help any further?

Michael H

Re: Loading simpleviewer as an external swf

YAY, I got it to work...I have no idea why it wasn't working. I didn't change any code or any lines, but I deleted all code and started from scratch. Must have been a dodgy character that I couldn't find.

Thanks so much for a great product and for your help.

Michael H (will be live by the end of February - currently old site)