Topic: Random URL selection for embedded simpleviewer pro link

Hi, I was hoping there might be a way to randomly direct an embedded link to one of four external simpleviewer folders on my site?

Here is the link to the index file:

http://timperceval.com/guiran/index.html

The four folders are located at:

http://timperceval.com/guiran/intro1
http://timperceval.com/guiran/intro2
http://timperceval.com/guiran/intro3
http://timperceval.com/guiran/intro4

At the moment I am only linking to intro1 but I would like that to be randomly chosen.

The embedded code is as follows:

<!--START SIMPLEVIEWER EMBED.-->
<script type="text/javascript" src="http://timperceval.com/guiran/intro1/svcore/js/simpleviewer.js"></script>
<script type="text/javascript">
var flashvars = {};
flashvars.baseURL = "http://timperceval.com/guiran/intro1/";
simpleviewer.ready(function () {
simpleviewer.load("sv-container", "100%", "100%", "000000", true, flashvars);
});
</script>
<div id="sv-container"></div>
<!-- END SIMPLEVIEWER EMBED --

Any ideas would be immensely appreciated!  smile

Thanks,

Tim

Re: Random URL selection for embedded simpleviewer pro link

Try the following:

<!--START SIMPLEVIEWER EMBED.-->
<script type="text/javascript" src="http://timperceval.com/guiran/intro1/svcore/js/simpleviewer.js"></script>
<script type="text/javascript">
var randomnumber=(Math.floor(Math.random()*4))+1;
var flashvars = {};
flashvars.baseURL = "http://timperceval.com/guiran/intro"+randomnumber+"/";
simpleviewer.ready(function () {
simpleviewer.load("sv-container", "100%", "100%", "000000", true, flashvars);
});
</script>
<div id="sv-container"></div>
<!-- END SIMPLEVIEWER EMBED -->
Steven Speirs
SimpleViewer Support Team.

Re: Random URL selection for embedded simpleviewer pro link

Thank you so much for this... it's a brilliant solution!  big_smile

Re: Random URL selection for embedded simpleviewer pro link

Actually on Internet Explorer it comes up with XML file cannot be found?

Do you have any idea where the incompatibility is?

Thanks again,

Tim

Re: Random URL selection for embedded simpleviewer pro link

Your web page seems to work OK in IE9 on my computer.
I do not see the 'Gallery XML Not Found.' message.
I have reloaded your page several times and have checked that all 4 galleries are operational.
In which version of Internet Explorer do you see the message?
Do you see the message every time the page is loaded or just sometimes?
Have you tried clearing your browser's cache before reloading the page?

Steven Speirs
SimpleViewer Support Team.

Re: Random URL selection for embedded simpleviewer pro link

You're right, I was testing it using VMware Fusion and it didn't even have flash installed!

Sorry to have bothered you with that trivial issue.

Thanks for your help again!