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

Suresh

Posted 8 years ago

Help me out, all my files is in folder videoplayer , but only index.html is out
but this code is not working, plz help

<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Strict//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd”>
<html xmlns=“http://www.w3.org/1999/xhtml” lang=“en” xml:lang=“en”> <head> <title></title> <meta http-equiv=“Content-Type” content=“text/html; charset=iso-8859-1” /> <script type=“text/javascript” src=“videoplayer/swfobject.js”></script> <script type=“text/javascript”> var flashvars = {}; flashvars.folderPath = “videoplayer/”; var params = {}; params.scale = “noscale”; params.salign = “tl”; params.wmode = “window”; params.allowfullscreen = “true”; var attributes = {}; swfobject.embedSWF(“videoplayer/VideoPlayerFX.swf”, “VideoPlayerFXFXDiv”, “600”, “360”, “9.0.0”, false, flashvars, params, attributes); </script> </head> <body> <div id=“VideoPlayerFXDiv”> <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> </body>
</html>

Gontran

Posted 8 years ago

Problem solved, thank you for your advice.

Gontran

Posted 8 years ago

The link

FlashXML Support

Hi,

Your SWF is named component1.swf and in the embedding code you write component1FX.swf. Rename the SWF file or make this change in the embedding code.

Gontran

Posted 8 years ago

Correction made on the site

FlashXML Support

Hi,

Send me the direct link to the webpage because I do not see any changes on the site even now.

Gontran

Posted 8 years ago

The errors were corrected as follows

<script type=“text/javascript”>
var flashvars = {};
flashvars.folderPath = “component1/assets /”;
flashvars.settingsXML = “component1/assets/settings.xml”;
var params = {};
params.scale = “noScale”;
params.salign = “tl”;
params.wmode = “transparent”;
var attributes = {};
swfobject.embedSWF (“component1/component1FX.swf”, “component1FXDiv”, “600”, “300”, “9.0.0”, false, flashvars, params, attributes);
</ script>
</ head>
<body>
<div id=“component1FXDiv”> </ div>

</ body>

But still nothing appears

FlashXML Support

Hi,

Could you make these changes in your index2.html in order to see why is not working? Because I checked your site and i don’t see where you have made these changes.

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