Topic: Alternate Image Folder Path

Hi guys, I'm new here!

I'd like to use AutoViewer with this structure in mind:


The goal is to dynamically call the correct gallery by passing a parameter to index.php.

I search around in the forum, and tried this:

1. Edit and add:

if (_root.imageFolderPath != undefined) imageFolderPath = _root.imageFolderPath;

2. Republish
3. Add to index.php (not dynamic, but I wanna test...)

var fo = new SWFObject("gallery1/autoviewer.swf", "autoviewer", "100%", "100%", "8", "#181818");    
fo.addVariable("xmlURL", "gallery1/gallery.xml");                    
fo.addVariable("imageFolderPath", "gallery1/images/"); 

When I access the page, the player is loaded, but the path to the images is wrong... I get an error looking like:
WEBSITE  / gallery / Index%20of%20 / gallery / gallery1 / images

Can any help me?



Re: Alternate Image Folder Path

You should only need one copy of the autoviewer.swf and just feed the xmldatapath using php.

Mike Richards
SimpleViewer Support Team.

Re: Alternate Image Folder Path

I know we only need on copy, but sometimes I use modified autoviewers.swf for certain galleries so that's why I did it this way.

With regards to xmlDataPath (xmlURL) it is fed by javascript in the example I provided. The problem occurs because in gallery.xml the image path are "images/image_name.jpg" and when the page is loading, we can't access the images because the path is imcomplete.

The idea was to provide the remainder of the path to the images by using imageFolderPath. By providing that information, the path "should" be correct. I can't get it to work though, as seen above.

Re: Alternate Image Folder Path

Is there a reason you for having image folder 1, 2, 3 etc? You could simply have one image folder that way you do not need to dynamically assign a path.

If you really want to do it the "hard" way this, "xmlResults.load(imageFolderPath);",  is not the correct way to do this. the XML image names come is as "images/theImage.jpg" and are stored into mXMLManager.aImageFileNames[i].

So what I would do is change your XML files to "<url>theImage.jpg</url>"

either add an xml attribute imageFolderPath and update to call this new attribute or continue to use _root.imageFolderPath

At the end of line 94 "var resultNode:XMLNode = xmlRoot.childNodes[i];" hit enter to add a new line and add:

var theImage = imageFolderPath + resultNode.childNodes&#91;0&#93;.firstChild.nodeValue;

Change aImageFileNames.push(... to:

Mike Richards
SimpleViewer Support Team.