Flash 对象未在 Safari 中加载

发布于 2024-10-28 15:49:53 字数 1328 浏览 1 评论 0原文

我已经构建了一个表单,并在表单元素旁边放置了一个 flash 对象。页面加载时,表单为display:block,flash对象为display:none。

布局看起来像这样(img 在那里,所以如果用户没有 flash,则会播放 gif 动画):

<form id="form"></form>
<div id="upload-anim-div">
  <object type="application/x-shockwave-flash"
      data="<?= PAL_STATIC_HOST ?>/music/introducing/flash/upload_animation.swf"
      width="626"
      height="600">
    <param name="movie" value="<?= PAL_STATIC_HOST ?>/music/introducing/flash/upload_animation.swf"/>
    <img src="<?= PAL_STATIC_HOST ?>/music/introducing/img/Anim-placeholder.gif" alt="upload animation (gif)"/>
  </object>
</div>

当我提交表单(只是上传文件)时,我隐藏表单并显示我的表单动画 div 在 javascript 中如下所示:

$('#form').hide();
$('#upload-anim-div').show();

这在除 Safari 之外的所有浏览器中都效果很好,其中会出现一个大的空白。右键单击此空白区域只会显示以下菜单:

Flash movie not loaded... _not clickable_
About Adobe Flash Player 10.5.blah...

为什么电影未加载/正在加载?!如果我只是在文档首次加载时显示电影(通过删除最初隐藏它的 JavaScript 行),它会加载并显示得很好!任何想法将不胜感激!

---编辑---

我现在尝试使用 swfobject,但遇到了完全相同的问题。我在 javascript 中使用了这种代码,在显示 upload-anim-div 后将我的 swf 嵌入到 javascript 中:

swfobject.embedSWF("myContent.swf", "upload-anim-div", "626", "600", "10");

有人有任何进一步的想法吗?

I've built a form, and next to my form element I've placed a flash object. When the page is loaded, the form is display: block, and the flash object is display: none.

The layout looks something like (the img is there so that if the user doesn't have flash, the gif animation will play instead):

<form id="form"></form>
<div id="upload-anim-div">
  <object type="application/x-shockwave-flash"
      data="<?= PAL_STATIC_HOST ?>/music/introducing/flash/upload_animation.swf"
      width="626"
      height="600">
    <param name="movie" value="<?= PAL_STATIC_HOST ?>/music/introducing/flash/upload_animation.swf"/>
    <img src="<?= PAL_STATIC_HOST ?>/music/introducing/img/Anim-placeholder.gif" alt="upload animation (gif)"/>
  </object>
</div>

When I submit my form, which is just to upload a file, I hide the form and display my animation div as follows in javascript:

$('#form').hide();
$('#upload-anim-div').show();

This works great in all browsers except Safari, where a big white space appears. Right clicking this white space simply gives me the following menu:

Flash movie not loaded... _not clickable_
About Adobe Flash Player 10.5.blah...

Why is the movie not loaded/loading?! If I simply display the movie when the document first loads (by removing the javascript line that initially hides it) it loads and displays fine! Any ideas would be greatly appreciated!

---EDIT---

I've now tried using swfobject, but get exactly the same problem. I used this kind of code in my javascript to embed my swf with javascript after displaying the upload-anim-div:

swfobject.embedSWF("myContent.swf", "upload-anim-div", "626", "600", "10");

Anyone have any further ideas?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(2

涙—继续流 2024-11-04 15:49:53

听起来 Safari 试图通过不在隐藏的 div 中渲染 Flash 来缩短页面加载时间。你如何将 Flash 放入 div 中,它只是一个对象标签,还是你使用像 swfobject 这样的东西?如果您使用 swfobject,则可以在显示它时将 Flash 写入 div。

Sounds like Safari tries to shave the page load time by not rendering Flash in a hidden div. How are you putting the Flash into the div, is it just an object tag, or are you using something like swfobject? If you're using swfobject you could write the Flash to the div when you reveal it.

寄意 2024-11-04 15:49:53

我认为您应该尝试使用 swfobject 嵌入 Flash 内容:

I think you should try to embed your Flash content with swfobject:

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