How do I use multiple simpleview galleries on my website?

  • Thread starter Thread starter a walker
  • Start date Start date
Status
Not open for further replies.
A

a walker

Guest
Embed multiple simpleviewer galleries on website

I can get simple viewer working no problems with 1 gallery on my site using the following code:

<head>
<script type="text/javascript" src="swfobject.js"></script>
</head>

<body>
<embed src="viewer.swf" bgcolor="#181818" name="viewer" width="64'" height="48'" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></embed>
</body>

The problem I have is when I want to use multiple galleries. As soon as I add directories the flash stops working. This is an example of what I have tried to change it to:

<head>
<script type="text/javascript" src="galleries\landscapes\swfobject.js"></script>
</head>

<body>
<embed src="galleries\landscapes\viewer.swf" bgcolor="#181818" name="viewer" width="64'" height="48'" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></embed>
</body>

How do I get multiple galleries to work?
 
You have to add some extra code to the page to make it happen, but it's totally possible. A good way to get started is to check out my TTG Stage template, set it up for use with SimpleViewer and export the page. You can then open the page in a text-editor and copy out the code it uses to draw a SimpleViewer gallery from another directory into the page.
 
is this the code?

<script type="text/javascript">
var fo = new SWFObject("simpleviewer/viewer.swf", "viewer", "1''%", "1''%", "7", "#''''''");
fo.addVariable("preloaderColor", "'xffffff");
fo.addVariable("xmlDataPath", "gallery.xml");
fo.addParam("base", "simpleviewer/");
fo.write("flashcontent");

</script>
 
if the above code is right i still can't get it working. are you able to post the correct code?

my directory from root is galleries/landscapes
 
That's the right code; I've added a containing DIV. You need to edit the path to the simpleviewer resources in the locations denoted below in red.

The word in green is the name of the containing DIV that is being replaced by the gallery (i.e. the wrapping DIV for the code below), and should also be changed; each instance of the gallery on a page should be unique.

<div id="flashcontent">

<script type="text/javascript">
var fo = new SWFObject("simpleviewer/viewer.swf", "viewer", "1''%", "1''%", "7", "#''''''");
fo.addVariable("preloaderColor", "'xffffff");
fo.addVariable("xmlDataPath", "gallery.xml");
fo.addParam("base", "simpleviewer/");
fo.write("flashcontent");

</script>
</div>
 
A Walker, why the double-post? I answered your question here.

In the above code, you're loading the swfobject.js script, and then attempting to call in your flash using the <embed> tag. If you're going to use swfobject.js (as you should), the <embed> is useless. The two are mutually exclusive; you need to choose one or the other.

As shown in the other post, the key to pulling in a SimpleViewer gallery from at alternate location is the "base" ( fo.addParam("base", "simpleviewer/"); ), where the red bit is the path to the simpleviewer gallery.
 
Last edited by a moderator:
i didn't realise the posts went through a moderator, i was then hoping the moderator would prevent the double post.
 
i didn't realise the posts went through a moderator, i was then hoping the moderator would prevent the double post.

And then the mods were all in a world of their own and never noticed! :mrgreen: Threads are merged.
 
Status
Not open for further replies.
Back
Top