Topic: The "viewer" attribute/tag in the "new SWFObject code line...?

The instructions to embed an Autoviewer gallery into an HTML page show the following:

<script type="text/javascript" src="swfobject.js"></script>
<div id="flashcontent">AutoViewer requires JavaScript and the Flash Player.
<a href="http://www.macromedia.com/go/getflashplayer/">Get Flash.</a></div>
<script type="text/javascript">
var fo = new SWFObject("autoviewer.swf", "viewer", "800", "600", "8", "#181818");
fo.write("flashcontent");
</script>

But...what is the "viewer" variable or tag in the var fo line above?  Is it the name of my specific flash file?  Do I have to change the name of the .swf file from "autoviewer" to "viewer"...?

Last edited by john givens (2012-03-08 21:54:59)

Re: The "viewer" attribute/tag in the "new SWFObject code line...?

As defined by the SWFObject v1.5 documentation on this page, the attribute is:

id – The ID of your object or embed tag. The embed tag will also have this value set as it’s name attribute for files that take advantage of swliveconnect.

For the embedding purposes of AutoViewer, it is not actually used so you can set it to any value you like.

Steven Speirs
SimpleViewer Support Team.

Re: The "viewer" attribute/tag in the "new SWFObject code line...?

Thank you, Steven.

Re: The "viewer" attribute/tag in the "new SWFObject code line...?

Another question on Autoviewer-Pro regarding the path to the files and folders:

When I create my Autoviewer slide show, I get the follwing in a single folder (call it "myshow"):
4 Files:
- gallery.xml
- index.html
- swfobject.js
- autoviewer.swf

1 folder:
-Images

When I upload these to my website (let's call it www.mysite.com) server, should I upload the entire "myshow" folder and its contents to the site so that the address (absolute path) to the files and folders then becomes www.mysite.com/myshow/autoviewer.swf, etc.?

Unless I put the show in a folder of its own, it would seem that the index file for the site would be confused with the index file of "myshow".

Can you comment on the proper paths to uploaded gallery (show) files and folders?

Thanks,

john

Last edited by john givens (2012-03-09 17:00:56)

Re: The "viewer" attribute/tag in the "new SWFObject code line...?

The 'index.html' file within the gallery folder is essentially an HTML page into which the gallery is embedded with no other content so, when viewed, the gallery is on its own page.

If you wish to link directly to a gallery, you can upload the entire gallery folder and link to the 'index.html' file within it.

If you wish to embed the gallery in another HTML page alongside other content, you can either:
(1) Upload the entire gallery folder and embed the gallery in your page using an <iframe> such as:

<iframe src="http://www.mysite.com/myshow/index.html" width="800" height="600" frameborder="0" scrolling="no"></iframe>

... or:
(2) Upload the contents of the gallery folder except for the 'index.html' file which is not required in this scenario to the same directory as the page into which you wish to embed the gallery, and embed the gallery using the embedding code found here: http://www.simpleviewer.net/autoviewer/ … dding.html

Steven Speirs
SimpleViewer Support Team.

Re: The "viewer" attribute/tag in the "new SWFObject code line...?

Thanks, again, Steven.
So, if I chose the 2nd method above to embed the show into my html page (not using the i-frame and the index file), it is that embed code that "calls" the autoviewer movie...and expects to find the autoviewer.swf file in the same directory - unless I show a different path to the specific autoviewer.swf that I want to use (such as myshow/autoviewer.swf)...? which referes to a swf file in the myshow folder.

True?

And - as you'd answered a few days ago to my query on multiple autoviewer shows on the same html page...
I could execute the same autoviewer.swf file for each of the shows, but wrap the embed code in a separate div and point to a unique gallery.xml file for each different show on the page.

Right?

thanks.

Re: The "viewer" attribute/tag in the "new SWFObject code line...?

it is that embed code that "calls" the autoviewer movie...

Yes.

and expects to find the autoviewer.swf file in the same directory - unless I show a different path to the specific autoviewer.swf that I want to use (such as myshow/autoviewer.swf)...?

Yes.

I could execute the same autoviewer.swf file for each of the shows, but wrap the embed code in a separate div and point to a unique gallery.xml file for each different show on the page.

Yes. All your galleries could share the same 'autoviewer.swf' file (and 'swfobjwect.js' file, too).

Steven Speirs
SimpleViewer Support Team.