Flash 内容未显示 - 如何设置路径?

发布于 2024-10-31 04:42:16 字数 1272 浏览 1 评论 0原文

我正在一个相当标准的页面上显示一些 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

被翻牌 2024-11-07 04:42:16

您可以尝试在其中插入 swfobject 代码吗?

    $(document).ready(function(){
     //Put your code here
    })

我还注意到 /flipbook/setup.xml 上的链接是相对于 /flipbook/ 的,您需要将其设置为绝对链接,以便可以在两个页面上使用。

此时,当闪光灯尝试加载 http://www.rouviere.com/ 时,闪光灯停止了writing/pages/tam_01.jpg 因为应用程序需要一个图像文件,其中该 url 返回网页。

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.

山川志 2024-11-07 04:42:16

我的第一个猜测是 Preview.swf 无法找到并加载 XML 文件。

默认情况下,Flash Player 解析相对于当前 HTML 页面的路径,而不是相对于 swf 文件所在位置的路径。您也许可以使相对路径起作用,但我建议在可能的情况下使用服务器根目录的完整路径,例如:

xmlPath: '/flipbook/setup.xml'

... 而不是:

xmlPath: '../../flipbook/setup.xml'

另一种可能的解决方案是使用基本参数,告诉 Flash Player 的路径是什么用作基础,例如:

xmlPath: 'setup.xml'
...
params.base = '/flipbook/'

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/'
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文