`
wayne173
  • 浏览: 358555 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

flash wmode参数详解 ()转

 
阅读更多

在做web开发中可能会遇到flash遮挡页面中元素的情况,无论怎么设置flash容器和层的深度(z-index)也无济于事,现有的解决方案是在插入flash的embed或object标签中加入”wmode”属性并设置为wmode=“transparent”或”opaque”,但wmode属性到底是什么意义,为什么可以解决这个问题呢?

window mode(wmode)

wmode即窗口模式总共有三种,看看当年Macromedia官方的说法:

  • Window: Use the Window value to play a Flash Player movie in its own rectangular window on a web page. This is the default value for wmode and it works the way the classic Flash Player works. This normally provides the fastest animation performance.
  • Opaque: By using the Opaque value you can use JavaScript to move or resize movies that don’t need a transparent background. Opaque mode makes the movie hide everything behind it on the page. Additionally, opaque mode moves elements behind Flash movies (for example, with dynamic HTML) to prevent them from showing through.
  • Transparent: Transparent mode allows the background of the HTML page, or the DHTML layer underneath the Flash movie or layer, to show through all the transparent portions of the movie. This allows you to overlap the movie with other elements of the HTML page. Animation performance might be slower when you use this value.

window 模式

默认情况下的显示模式,在这种模式下flash player有自己的窗口句柄,这就意味着flash影片是存在于Windows中的一个显示实例,并且是在浏览器核心显示窗口之上的,所以flash只是貌似显示在浏览器中,但这也是flash最快最有效率的渲染模式。由于他是独立于浏览器的HTML渲染表面,这就导致默认显示方式下flash总是会遮住位置与他重合的所有DHTML层。

但是大多数苹果电脑浏览器会允许DHTML层显示在flash之上,但当flash影片播放时会出现比较诡异的现象,比如DHTML层像被flash刮掉一块一样显示异常。

Opaque 模式

这是一种无窗口模式,在这种情况下flash player没有自己的窗口句柄,这就需要浏览器需要告诉flash player在浏览器的渲染表面绘制的时间和位置。这时flash影片就不会在高于浏览器HTML渲染表面而是与其他元素一样在同一个页面上,因此你就可以使用z-index值来控制DHTML元素是遮盖flash或者被遮盖。

Transparent 模式

透明模式,在这种模式下flash player会将stage的背景色alpha值将为0并且只会绘制stage上真实可见的对象,同样你也可以使用z-index来控制flash影片的深度值,但是与Opaque模式不同的是这样做会降低flash影片的回放效果,而且在9.0.115之前的flash player版本设置wmode=”opaque”或”transparent”会导致全屏模式失效。

了解了各种模式的实现方式和意义在以后的开发中就可以按照具体情况选择设置wmode属性的值了。

分享到:
评论

相关推荐

    网页中flash wmode属性你会用吗?

    在做web开发中可能会遇到flash遮挡页面中元素的情况,无论怎么设置flash容器和层的深度(z-index)也无济于事,现有的解决方案是在插入flash的embed或object标签中加入”wmode”属性并设置为wmode=“transparent”或”...

    html元素遮挡flash详解示例

    复制代码代码如下:wmode参数:transparent模式:可用z-index控制层级opaque模式:可用z-index控制层级window模式:flash层级在浏览器核心显示窗口之上,flash会盖住与他重合的html 情景1(可修改flash的wmode参数)...

    FLASH三维状滚动图片 由模糊到清楚效果.rar

    flashWrite(链接,宽度,高度,ID,背景色,FlashVars,wmode) x_radiusX x_radiusY 图片之间的距离参数 x_centerX x_centerY 整个效果上下边距参数 x_imgWidth x_imgHeight 图片宽度和高度参数 x_Rspeed 滚动速度...

    VB结合Flash实现动态按钮.rar

    VB结合Flash实现动态按钮,当Flash按钮命令为Norksoft Studio时触发,若要让Flash背景透明,请在Flash的 WMode 属性设置为Transparent,ShowMsg = MsgBox("哈!你刚才单击了【点击下载】按钮", 64, "温馨提示") '打开...

    flash音乐动画千年白狐

    pluginspage=http://www.macromedia.com/go/getflashplayer src=http://file.edmin.cn/2010/day_110109/20110109_1788337d0cee0c568e62Qqq2iu2LA0qu.swf width=660 height=480 type=application/x-shockwave-flash ...

    免费下载 解决FLASH有背景色 使FLASH透明不被遮挡

    在添加的FLASH调用代码中增加"<param name="wmode" value="transparent">"即可实现透明化。 <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase=...

    Flex 设置WMODE 后滚轮失效解决的示例源码

    源码来自开源项目:flex-wmode-mousewheel-handler-example ,解决flex设置wmode参数后鼠标滚轮失效的问题。(源码环境为 flex sdk 3.2)

    4屏flash的flash文件及源码(在网站首页切换显示图片)

    0,28,0','width','550','height','280','src','swf/4imgflash','quality','high','pluginspage','http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash','wmode','transparent','...

    【原创】VB与FLASH的交互

    【原创】VB与FLASH的交互 flash空间的wmode=transparent 可以设置透明 ShockwaveFlash.Menu = False

    flashobject.js

    var fo = new FlashObject("flashfile\自作风速.swf", "mymovie", "300", "200px", "7", "#336699"); fo.addParam("quality", "low"); fo.addParam("wmode", "transparent"); fo.addParam("salign", "t"); ...

    Flash插件本地下载

    92. swf = new ActiveXObject('ShockwaveFlash.ShockwaveFlash');//IE已经安装Flash插件 93. if(swf) 94. { 95. LoGo.style.display="none"; 96. Chrome.style.display="block"; 97. } 98. } 99. catch(e)//...

    一句js代码显示flash

    function LoadFlash(url,wmode,width,Height) { var flashcode = '...

    原创flash音乐动画《知我无情有情》

    pluginspage=http://www.macromedia.com/go/getflashplayer src=http://file.edmin.cn/2010/day_110102/20110102_8aead3ebe6aa65329463tveXcTQzqGGc.swf width=660 height=480 type=application/x-shockwave-flash ...

    一个可屏蔽FLASH右键和使用FLASH 右键的JS插入FLASH脚本

    格式型如 如<flash id="Mack" name="Mack" src="RightClick.swf" width="560" height="420" Version="10.0.0" param="{wmode:'opaque'}" expsrc="expressInstall.swf" rightclick="rightClick"/> 支持 右键 如需要...

    网站flash背景音乐源程序可以指定自己的音乐

    <param name="movie" value="/flash/music.swf" /> <param name="wmode" value="transparent"> 音乐.mp3"> 使用时替换“音乐.mp3”文件为你自己的文件名

    WP-Cumulus 标签云(flash+xml+js) 支持中文

    <embed tplayername="SWF" splayername="SWF" type="application/x-shockwave-flash" src="tagcloud.swf?r=8269298" mediawrapchecked="true" pluginspage=...

    如何让Flash不遮挡HTML div元素的技巧

    让flash置于DIV层之下的方法,让flash不挡住飘浮层或下拉菜单,让Flash不档住浮动对象或层的关键参数:wmode=opaque。 方法如下: 针对IE 在<object></object>内加上参数<param name=wmode value=...

    143种透明Flash打包下载

    143种透明Flash打包奉送。 透明Flash的使用方法: 在插入flash的代码中插入<param name="wmode" value="transparent">即可实现flash背景透明

    获取服务器时间的Flash钟表

    <param name='wmode' value='transparent' /> <embed src='flash/r.swf' quality='high' pluginspage='...

Global site tag (gtag.js) - Google Analytics