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

Gontran

Posted 8 years ago

the files are posted on my test site

FlashXML Support

Hi,

When you set the settings.xml file through the flashvars variable you are using flashvars1, so you have to write it in this way: flashvars.settingsXML= “component1/assets/settings.xml”;.
Also replace your code line with the following one:

swfobject.embedSWF("component1/component1FX.swf", "Component1FXDiv", "600", "300", "9.0.0", false, flashvars, params, attributes);

Gontran

Posted 8 years ago

Hello.

I tested the example cited above, with due observance of the instructions.
So I have my index.html file in the root of my site.

Component1 folder that contains:

_ the file component1.swf

_ 1 folder with inside js swfobject.js

_1 File Assets with inside the CSS file, folder, images, the Skins folder, my file images.xtml and settings.xtml

and here is my source code

<script type=“text/javascript” src=“component1/js/swfobject.js”></script>
<script type=“text/javascript”>
var flashvars = {};
flashvars.folderPath = “component1/assets/”;
flashvars1.settingsXML= “component1/assets/settings.xml”;
var params = {};
params.scale = “noscale”;
params.salign = “tl”;
params.wmode = “transparent”;
var attributes1 = {};
swfobject.embedSWF(“component1/Component1FX.swf”, “component1FXDiv”, “600”, “300”, “9.0.0”, false, flashvars, params, attributes);
</script>

But unfortunately nothing appears

FlashXML Support

Hi,

Send us the link to your website and we will check it out.

Lauren

Posted 8 years ago

Hi,
I tried changing the folderpath to (http://abe.midco.net/lauren/gallery/) and it still does not want to load. When I go to the index.html page through firefox it says ‘waiting for midco.net’, the place where I have all the files saved. I must be doing something wrong but cannot find. I have changed the settings.xml file and images.xml file with the updated links. I have all of the folders in the assets folder, and then the swf and js file just in the gallery folder.Any other suggestions to get this to work? Thanks!

FlashXML Support

Hi,

Your settings.xml is not well formated. Upload again this file at this location http://abe.midco.net/lauren/gallery/assets/. I suggest you to use Live Demo from our site to customize your settings.

Lauren

Posted 8 years ago

Hello, I purchased the ImageScrollFX gallery and am having some difficulties getting it to work. My plan is to place the gallery on an ebay auction. I have saved all of my information on an off site storage area and have created an html page that I will be placing on eBay. I have put the html file on my storage site for you to view to see what is the potential problem. Is this going to work on an ebay page that uses the links from a different site?

Thank you!
Lauren

FlashXML Support

Hi,

Try to set the folderPath in the embedding code like in the example below.
e.g:

http://abe.midco.net/lauren/gallery/

thomas ryan

Posted 8 years ago

Tried to follow your explanation of linking and paths and simply couldn’t understand it or make it work. I think you should have someone beta text your directions first as you probably can’t see the forest through the trees…..Anyway, here is what I am trying to do. I created a folder on my computer named FLASHXML. I then created a subfolder called PHOTOFLIPPER where I downloaded your application. Opened the index.html file and it worked just fine. I then moved the index.html and put it directly in the FLASHXML folder to simulate what I am doing in my actual application. Of course, nothing works. Here is the code that I am trying to run”

.<script type=“text/javascript” src=”../photoflipper/swfobject.js”></script> <script type=“text/javascript”> var flashvars = {}; flashvars.folderPath = “../photoflipper/”; var params = {}; params.scale = “noscale”; params.salign = “tl”; params.wmode = “window”; params.allowfullscreen = “true”; var attributes = {}; swfobject.embedSWF(”../../PhotoFlipperFX.swf”, “PhotoFlipperFXDiv”, “500”, “420”, “9.0.0”, false, flashvars, params, attributes); </script>

Also have:

<div id=“PhotoFlipperFXDiv”> <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>

So where did I go wrong?

Thanks.

Tom

FlashXML Support

Hi,

In this example, the folder structure and the files ‘location it’s a little different than what you have. Using ../ means to go one folder up but it’s not the case for you. Here is how your embedding code should look like:

<script type="text/javascript" src="photoflipper/swfobject.js"></script>
<script type="text/javascript">
var flashvars = {};
flashvars.folderPath = "photoflipper/";
var params = {};
params.scale = "noscale";
params.salign = "tl";
params.wmode = "window";
params.allowfullscreen = "true";
var attributes = {};
swfobject.embedSWF("photoflipper/PhotoFlipperFX.swf", "PhotoFlipperFXDiv", "600", "600", "9.0.0", false, flashvars, params, attributes);
</script>

Also, make sure that you use the absolute path for the images you load in the CDATA attribute to make them work.

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