Questions

Answer

How to specify the correct path in the embedding code of the SWFs

 

Generally, you must know that the path of the assets the SWF uses (the path of the images or videos specified in the XML file and the path of the XML files themselves) must be relative to the path of the HTML file which embeds the SWF file (and not relative to the SWF file - a common confusion).

If the folder path of the HTML differs from the product’s folder path (the folder in which the XML files and images or videos are located) then you must specify that path as value for the base attribute.

This is an example for 3D Banner FX (replace the product's name if you're using a different one):

- the index.html file is located at this address on your domain: http://www.yourdomain.com/index.html

- the swfobject.js file is located at this address: http://www.yourdomain.com/Banner/swfobject.js

- the product's files (XMLs, assets and images) are located in the Banner folder: http://www.yourdomain.com/Banner/

- the 3DBannerFX.swf file is located in the product's folder: http://www.yourdomain.com/Banner/3DBannerFX.swf

This is the embedding code you have to use:

<div id="Div3DBannerFX"></div>
<script type="text/javascript" src="Banner/swfobject.js"></script> //specify the folder's name here
<script type="text/javascript">
 var flashvars = {};
 var params = {};
 params.base = "Banner/"; //specify the folder's name here
 params.scale = "noscale";
 params.salign = "tl";
 params.wmode = "transparent";
 params.allowFullScreen = "true";
 params.allowScriptAccess = "always";
 swfobject.embedSWF("Banner/3DBannerFX.swf", "Div3DBannerFX", "600", "374", "9.0.0", false, flashvars, params); //specify the folder's name here
</script>

You can also use absolute paths like in this example:

params.base = "http://www.yourdomain.com/Banner/";

In case you used a different folder name don't forget to replace in all locations the Banner name with the name of your folder.

Note: there are three different locations in the embedding code where you have to specify the product's folder name so make sure you update all of them.

Comments

Barbara

Posted 8 years ago

I purchased ImageScroller FX for my website and it’s great. I want to use the side with the ImageSroller as a start side for my website and because of this the html page with the <div id=“ImageScrollerFXDiv”></div> has to be in the main folder as “index.html”. Also you described pretty good how to dow it on your site I can’t get it right (maybe because of my skimpy English skills).

This is what I did:

Designed the start page with ImageScroller FX in it (it was then in the folder with all the files and folders that came with ImageScroller, named it: “test_hintergrundverlauf.html” ) – Page looked good and worked!
The path to this folder with all the ImageScroller files and folders are located on my computer here: F:/bhpimfokus/test_hintergrundverlauf_kopie
Renamed the html page with the div container to “index.html and put it into the main folder of my site. Path of this index file is F:/bhpimfokus

Copyed from you site and put in like this:

script type=“text/javascript” src=“swfobject.js”></script>
<script type=“text/javascript”>
var flashvars = {};
flashvars.folderPath = “F:/bhpimfokus/test_hintergrundverlauf_kopie”/;
var params = {};
params.scale = “noscale”;
params.salign = “tl”;
params.wmode = “transparent”;
var attributes = {};
swfobject.embedSWF(“ImageScrollerFX.swf”, “ImageScrollerFXDiv”, “1000”, “373”, “9.0.0”, false, flashvars, params, attributes);
</script>

When I click on the new index.html I just only the frames of the containers but no pictures and no graphic elements. I guess the index side can’t find the right location of all the files and folders from ImageScroller FX.

Contents of the ImageScroller FX folder:
Folder “assets”
Folder “images”
Folder “lightbox”
File “changelog.txt
File “images.xml
File “ImageScrollerFX.mxp
File “ImageScrollerFX.swf
File “index.html (that is the one that was in your folder)
File “settings.xml
File “swfobject.js
File “test_hintergrundverlauf.html” (this the the one that should be the new index.html the start the website)

Could you please point a newbie into the right direction and tell me in which files I’ve to change what. Thanks for you help in advance.
Barbara

FlashXML Support

Hi,

This is how the embedding code should be:

script type=“text/javascript” src=“swfobject.js”></script>
<script type=“text/javascript”>
var flashvars = {};
flashvars.folderPath = “F:/bhpimfokus/test_hintergrundverlauf_kopie/";
var params = {};
params.scale = “noscale”;
params.salign = “tl”;
params.wmode = “transparent”;
var attributes = {};
swfobject.embedSWF(“F:/bhpimfokus/test_hintergrundverlauf_kopie/ImageScrollerFX.swf”, “ImageScrollerFXDiv”, “1000”, “373”, “9.0.0”, false, flashvars, params, attributes);
</script>

MIrch

Posted 8 years ago

Thanks for your observation on where to look. I found out that every script which uses smarty needs to sorount the code with {literal}...........{/literal}. This repaired my problem.

Example in my case:
<script type=“text/javascript” src=“http://www.spectromartini.com/uploads/swfobject.js”></script>
<script type=“text/javascript”>
{literal}var flashvars = {};{/literal}
flashvars.folderPath = “http://www.spectromartini.com/uploads/”;
{literal}var params = {};{/literal}
params.scale = “noscale”;
params.salign = “tl”;
params.wmode = “transparent”;
params.allowfullscreen = “true”;
{literal}var attributes = {};{/literal}
swfobject.embedSWF(“http://www.spectromartini.com/uploads/BannerRotatorFX.swf”, “BannerRotatorFXDiv”, “600”, “260”, “9.0.0”, false, flashvars, params, attributes);
</script>

Thank you again love the banner :)

Mirch

Posted 8 years ago

Hi,
I’m using CMSMS script, which uses template system. This script only alows to edit pages (php) through admin. It also doesent specify in which folder pages are stored. So I needed to upload all the files of this banner in folder “uploads” (full path: http://www.spectromartini.com/uploads/). If I go directly to this folder I see the banner, but if I go to the site I edited it for banner, I dont see it.
I have tryed with absolute and relative paths and it doesen’t work. I haven’t changed any names of the files (xml, swf…) I left all the original picutes and names.

Here is what I used in head:

<script type=“text/javascript” src=“http://www.spectromartini.com/uploads/swfobject.js”></script>
<script type=“text/javascript”>
var flashvars = {};
flashvars.folderPath = “http://www.spectromartini.com/uploads/”;
var params = {};
params.scale = “noscale”;
params.salign = “tl”;
params.wmode = “transparent”;
params.allowfullscreen = “true”;
var attributes = {};
swfobject.embedSWF(“http://www.spectromartini.com/uploads/BannerRotatorFX.swf”, “BannerRotatorFXDiv”, “600”, “260”, “9.0.0”, false, flashvars, params, attributes);
</script>

and body:

<div id=“BannerRotatorFXDiv”> <a href=“http://www.adobe.com/go/getflashplayer”><img src=“http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif” alt=“Get Adobe Flash player” /></a>
</div>

What am I doing wrong?
Thanks

FlashXML Support

Hi,

We’ve checked your embedding code there seem that the brackets “ { “ and “ } “ are missing from flashvars , params and attributes.
e.g:

var flashvars = ;    //  HERE
flashvars.folderPath = "http://www.spectromartini.com/uploads/";
var params = ;    // HERE
params.scale = "noscale";
params.salign = "tl";
params.wmode = "transparent";
params.allowfullscreen = "true";
var attributes = ;     //  HERE

Attila Nagy

Posted 8 years ago

A virtual exhibition administration site only allows to upload SWF files as a banner. We can’t edit the HTML code on the site! Is there any other possibility to specify the path?

FlashXML Support

Hi,

Unfortunately we do not believe it could work.
Needing exterior assets other than the SWF file this means you’ll have to upload all the other files too, and then all the file need to be as in the same place as the webpage, and the embedding code should be similar to ours.

Kyzer

Posted 8 years ago

Hi I was trying the Flash Dock Menu Fx and I have the whole thing on my file manager and stuff. It works on my computer. It works when I view it on my file Manager. But on my website it shows just “flashxml.net” icon,
I don’t know what is wrong and my website tech support wasn’t much help.

FlashXML Support

Hi,

Just checked your site and the DockMenu was working OK. Please clear the browser’s cache and refresh the page.

Do you have a question?

you will get an answer in 24 hours, tops.

(required) Only alphanumeric characters allowed
(required) (will not be published)
Please type a message! Your message is too long! Either try to keep within 1500 characters, or contact our support team via email at support [at] flashxml.net.
(will not be published)
You mistyped the two words!
Can't read? Change the image
Format your comments using Textile: *bold*, _italic_, "link text":address, @code@
Connect to us on Facebook Follow us on Twitter Subscribe to our RSS feed
Copyright © FlashXML.net 2009 - 2019