固定路径和相对路径有什么区别?
我正在一个相当标准的页面上显示一些 Flash 内容。当 flash、xml 文件和 html 页面位于同一目录中时,这种方法非常有效。
请参阅工作示例: http://www.rouviere.com/flipbook/
但是,我想显示另一个页面中的相同内容位于站点内部较深处,但位于包含 .swf 和 .xml 文件以及资产的目录之外。
这是我希望内容正确显示的页面: http://www.rouviere.com /writing/books
以下是我设置的参数:
<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>
js 文件已正确加载,但 flash 内容未正确加载,因此我需要一些帮助来解决这个问题。
谢谢。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您的 XML 路径可能应该相对于 SWF 的位置编写,假设是由 SWF 加载它。否则,请提供以
/
开头的 Web 根目录中的所有绝对 URL。Your XML path should probably be written as relative to the location of the SWF, assuming that it's the SWF that will load it. Otherwise give everything absolute URLs from the web root starting with
/
.