Reputation: 10982
I am displaying some flash content on a fairly standard page. This works really well when the flash, xml file and html page are sitting together in the same directory.
See working example: http://www.rouviere.com/flipbook/
However, I want to display that same content in another page which is deeper inside the site but outside of the directory that houses the .swf and .xml files as well as the assets.
Here is the page that I would like the content to show up properly on: http://www.rouviere.com/writing/books
Here are the parameters that I have set:
<script type="text/javascript" src="../../flipbook/swfobject.js" charset="utf-8"></script>
<script type="text/javascript" src="../../flipbook/swfaddress.js" charset="utf-8"></script>
<script type="text/javascript">
var flashvars = {
xmlPath: '../../flipbook/setup.xml',
preloaderMessage: 'LOADING XML',
title: 'Books | Rouviere Media'
};
var params = {};
var attributes = {id:'flipbook', name:'flipbook'};
params.scale = "noscale";
params.salign = "tl";
params.bgcolor = "0x000000";
params.allowfullscreen = "true";
params.allowScriptAccess = "always";
swfobject.embedSWF("../../flipbook/preview.swf", "myAlternativeContent", "100%", "100%", "9.0.0", "expressInstall.swf", flashvars, params, attributes);
</script>
The js files are loading properly but the flash content is not, so I could use a little help getting that sorted out.
Thanks.
Upvotes: 0
Views: 1492
Reputation: 6740
Can you try insert the swfobject code within
$(document).ready(function(){
//Put your code here
})
I also noticed that the links on /flipbook/setup.xml is relative to /flipbook/ you need to make it absolute so that it can be used on both pages.
At the moment the flash stopped when it tries to load http://www.rouviere.com/writing/pages/tam_01.jpg since the app expects an image file where that url is returning webpage.
Upvotes: 1
Reputation: 6127
My first guess would be that the preview.swf fails to find and load the XML file.
By default, Flash Player resolves paths relative to the presenting HTML page, not relative to where the swf file is. You can probably make relative paths work, but i would recommend using full paths from the root of the server, when possible, like:
xmlPath: '/flipbook/setup.xml'
... instead of:
xmlPath: '../../flipbook/setup.xml'
Another possible solution is to use the base parameter, to tell Flash Player what path to use as base, like:
xmlPath: 'setup.xml'
...
params.base = '/flipbook/'
Upvotes: 0