将任意 Flash 对象 wmode 更改为透明
我需要将任意 Flash 对象的 wmode
更改为对外部 js 文件透明,以确保它们在不使用 Jquery 或类似库的情况下不会隐藏菜单。
在 FF 中,我使用 getElementsByTagName("embed") 并设置属性。 看起来效果不错。
具体来说,我在 IE7 中由 swfObject
库设置的 object
遇到问题。
swfObject
在 iE7 中创建以下代码:
<OBJECT id=mymovie height=400 width=134 classid=clsid:D27CDB6E-AE6D-11cf-96B8-444553540000>
<PARAM NAME="_cx" VALUE="3545">
<PARAM NAME="_cy" VALUE="10583">
<PARAM NAME="FlashVars" VALUE="">
<PARAM NAME="Movie" VALUE="imgs/site/tower.swf">
<PARAM NAME="Src" VALUE="imgs/site/tower.swf">
<PARAM NAME="WMode" VALUE="Window">
<PARAM NAME="Play" VALUE="0">
<PARAM NAME="Loop" VALUE="-1">
<PARAM NAME="Quality" VALUE="High">
<PARAM NAME="SAlign" VALUE="">
<PARAM NAME="Menu" VALUE="-1">
<PARAM NAME="Base" VALUE="">
<PARAM NAME="AllowScriptAccess" VALUE="">
<PARAM NAME="Scale" VALUE="ShowAll">
<PARAM NAME="DeviceFont" VALUE="0">
<PARAM NAME="EmbedMovie" VALUE="0">
<PARAM NAME="BGColor" VALUE="FFFFFF">
<PARAM NAME="SWRemote" VALUE="">
<PARAM NAME="MovieData" VALUE="">
<PARAM NAME="SeamlessTabbing" VALUE="1">
<PARAM NAME="Profile" VALUE="0">
<PARAM NAME="ProfileAddress" VALUE="">
<PARAM NAME="ProfilePort" VALUE="0">
<PARAM NAME="AllowNetworking" VALUE="all">
<PARAM NAME="AllowFullScreen" VALUE="false">
</OBJECT>
我尝试了各种可能的方法将 wmode
设置为 transparent
并使 Flash 不隐藏浮动对象,但没有成功,包括但不限于:
- 搜索
OBJECT
并将其PARAM
wmode
更改为transparent
。 - 设置
对象
的属性(wmode=transparent
) - 调用
对象
的SetValue
函数
似乎没有工作。 尽管 wmode 似乎发生了变化,Flash 仍然隐藏了其他具有高 z-index 的对象。 我在这里缺少什么?
I need to change wmode
of arbitrary flash objects to transparent from external js file to make sure they don't hide menus without using Jquery or similar libs.
In FF I use getElementsByTagName("embed")
and set attribute. It seems to work well.
Specifically I'm having trouble with object
set by swfObject
library In IE7.
swfObject
creates the following code in iE7:
<OBJECT id=mymovie height=400 width=134 classid=clsid:D27CDB6E-AE6D-11cf-96B8-444553540000>
<PARAM NAME="_cx" VALUE="3545">
<PARAM NAME="_cy" VALUE="10583">
<PARAM NAME="FlashVars" VALUE="">
<PARAM NAME="Movie" VALUE="imgs/site/tower.swf">
<PARAM NAME="Src" VALUE="imgs/site/tower.swf">
<PARAM NAME="WMode" VALUE="Window">
<PARAM NAME="Play" VALUE="0">
<PARAM NAME="Loop" VALUE="-1">
<PARAM NAME="Quality" VALUE="High">
<PARAM NAME="SAlign" VALUE="">
<PARAM NAME="Menu" VALUE="-1">
<PARAM NAME="Base" VALUE="">
<PARAM NAME="AllowScriptAccess" VALUE="">
<PARAM NAME="Scale" VALUE="ShowAll">
<PARAM NAME="DeviceFont" VALUE="0">
<PARAM NAME="EmbedMovie" VALUE="0">
<PARAM NAME="BGColor" VALUE="FFFFFF">
<PARAM NAME="SWRemote" VALUE="">
<PARAM NAME="MovieData" VALUE="">
<PARAM NAME="SeamlessTabbing" VALUE="1">
<PARAM NAME="Profile" VALUE="0">
<PARAM NAME="ProfileAddress" VALUE="">
<PARAM NAME="ProfilePort" VALUE="0">
<PARAM NAME="AllowNetworking" VALUE="all">
<PARAM NAME="AllowFullScreen" VALUE="false">
</OBJECT>
I tried every possible way to set wmode
to transparent
and make the flash not hide floating objects without success including but not limited to:
- Search for
OBJECT
and change itsPARAM
wmode
totransparent
. - Set attribute of
Object
(wmode=transparent
) - Call the
object
'sSetValue
function
None seems to work. Although the wmode seems to change Flash still hides other objects with high z-index
. What am I missing here?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
我已经成功地使用了这个小技巧:
它有效地重绘了 Flash 对象,对我有用。
I've been successful with this little trick:
It effectively redraws the flash object, worked for me.
总的来说,Cirday 的解决方案是正确的。 这是一个非 jQuery 版本,适用于 IE、FF 和 Chrome:
Cirday's solution in general is the right one. Here's a non-jQuery version, that works in IE, FF and Chrome:
当您使用 SWFObject 包含 Flash 时,embedSWF 方法中应该有一个名为“params”的参数。 您可以像这样向其中传递一个对象:
更多信息
When you are using SWFObject to include the flash, there should be a parameter in the embedSWF method called 'params'. You pass it an object into it like this:
more here
需要重新发布 Flash 影片才能更改 wmode 参数的说法是不正确的 - 这是一个神话:
http://www.communitymx.com/content/article.cfm?cid=E5141
我有同样的菜单问题,我需要一些代码将 wmode 参数添加到正在调用的任何 flash 对象JavaScript。
我认为原始帖子与此相关,但我不确定从哪里开始并且需要更多信息。
It's not true that a flash movie needs to be republished to change the wmode parameter - its a myth:
http://www.communitymx.com/content/article.cfm?cid=E5141
I have the same menu problem, and I need some code to add the wmode parameter to any flash object being called by javascript.
I think the original post pertains to this, but I'm not sure where to start and need more info.
我几乎 100% 确定您无法在运行时更改 wmode 参数。 我的意思是,技术上可以,但不会有任何效果。 事实上,我对你的成功尝试感到惊讶。 您尝试成功的 Flash 播放器版本和浏览器是什么?
很抱歉,我找不到任何官方链接来证明我的观点,但我会给您留下这个关于 wmode 如何工作的非常有趣的链接(更新到播放器 10):
GPU 加速是什么意思?
干杯,
Juan
I'm almost 100% sure that you cannot change the wmode parameter at runtime. I mean, you technically can, but won't have any effect. I'm actually surprised that you got any successful attempts. What Flash player version and browser did you try successfully?
I'm sorry I can't find any official link to prove my point, but I'll leave you this very interesting link about how wmode works (updated to player 10):
What does GPU acceleration mean?
Cheers,
Juan