swfobject 在 swf 加载之前闪烁白色

发布于 2024-10-17 07:21:16 字数 535 浏览 3 评论 0原文

我有以下代码,我已经设置了背景颜色,但我的页面在 swf 加载之前仍然闪烁白色。基本上我希望背景始终为黑色,我的页面正文标记有黑色背景。

<script type="text/javascript">

var path = "/media/19519/la_03.swf";
var videowidth = "955";
var videoid = "swf1454";
var videoheight = "540";
var flashvars = {};
var attributes = {};
var params = {
wmode: "opaque",
bgcolor: "#000000",  
  allowfullscreen: "true",
  allscriptaccess: "always"
};

swfobject.embedSWF(path, videoid, videowidth, videoheight, "9.0.0", flashvars, params, attributes);

        </script> 

I have the following code, I have set the bgcolor and still my page flashes white prior to swf loading. Basically i want the background to always be black, my page body tag has a black background.

<script type="text/javascript">

var path = "/media/19519/la_03.swf";
var videowidth = "955";
var videoid = "swf1454";
var videoheight = "540";
var flashvars = {};
var attributes = {};
var params = {
wmode: "opaque",
bgcolor: "#000000",  
  allowfullscreen: "true",
  allscriptaccess: "always"
};

swfobject.embedSWF(path, videoid, videowidth, videoheight, "9.0.0", flashvars, params, attributes);

        </script> 

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

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

发布评论

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

评论(4

世态炎凉 2024-10-24 07:21:16

它可能来自您的 swf 加载。我在处理大型 swf 时遇到了类似的问题,我让它停止的方法是在第一帧中暂停 swf,直到加载完成。然后只需在 1 处放置一个空帧并将其设为背景颜色即可。一旦 swf 准备就绪,动画就会开始

it's probably from your swf loading. I had a similar problem with a large swf and the way I got it to stop was to pause the swf in the first frame until it was done loading. Then just put an empty frame at 1 and make it the bg color. Once the swf is ready to go the animation starts

_蜘蛛 2024-10-24 07:21:16

确保包含 swf 的 html 元素也是黑色的。

Make sure the html element containing the swf is black too.

小猫一只 2024-10-24 07:21:16

我知道这是一篇旧文章,但对于通过搜索引擎偶然发现这篇文章的人来说:

白色闪光有时是 SWFObject 的“自动隐藏”功能的副产品(CSS 用于在 SWF 加载之前隐藏后备内容)。如果您不想看到白色闪光,请尝试禁用 SWFObject 的自动隐藏功能:

SWFObject 文档:

当然,您构建 SWF 的方式也会影响您是否看到白色闪光。

I know this is an old post, but for people who stumble upon this post via search engines:

A flash of white is sometimes a byproduct of SWFObject's 'autohide' feature (CSS is used to hide the fallback content before the SWF loads). If you don't want to see the flash of white, try disabling SWFObject's autohide feature:

SWFObject documentation:

Of course, how you build your SWF will also impact whether you see a flash of white.

诗笺 2024-10-24 07:21:16

对我来说,问题在于 swf 文件的背景颜色。
如果未明确设置,则在加载之前默认为白色。所以只要明确设置它,就不会出现白色闪光。

var params = {bgcolor:"#000000"};
swfobject.embedSWF("my.swf", "flash", "100%", "100%", "10.0.0", false, {}, params);

For me, the issue was in background color of the swf file.
When not explicitly set, it defaults to white until loaded. So just set it explicitly and you won't have a white flash.

var params = {bgcolor:"#000000"};
swfobject.embedSWF("my.swf", "flash", "100%", "100%", "10.0.0", false, {}, params);
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文