网络编程
位置:首页>> 网络编程>> 网页设计>> Flash的Fallback Content等

Flash的Fallback Content等

 来源:陈成的博客 发布时间:2010-04-01 12:18:00 

标签:flash,浏览器,插件,兼容

看youa的源码发现的,原来flash可以有fallback content:



<object type="application/x-shockwave-flash" data="...ny2010.swf" width="300" height="100" > <param name="movie" value="...ny2010.swf" wmode="transparent"> <param name="menu" value="false"> <param name="wmode" value="transparent"> <a href="..." target="_blank"><img src=".../ny2010.png" alt="..." width="300" height="100"></a></object>



测试了Safari 4, Firefox 3, IE6/7/8禁用Flash插件的访问,均无兼容问题。

但是却有另外两个问题,都是IE下的:

  1. Flash文件会被请求两次;

  2. Flash要等全部下载好才播放;(尚未仔细验证)

==

所以最终采各家(见文末rel)所长后用了这种写法:

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="300" height="68"> <param name="movie" value=".../T1isRtXlNEXXXXXXXX.swf"> <param name="wmode" value="transparent"> <!--[if !IE]>--> <object type="application/x-shockwave-flash" data=".../T1isRtXlNEXXXXXXXX.swf" width="300" height="68"> <param name="wmode" value="transparent"> <!-- for firefox --> <!--<![endif]-->  <a href="http://www.taobao.com/" target="_top" style="height:43px;margin-left:56px;">   淘宝网   <img width="167" height="110" src=" alt="淘宝网" title="Taobao.com - 阿里巴巴旗下网站">  </a> <!--[if !IE]>--> </object> <!--<![endif]--></object>

==

在HTML5 Spec中找到下面两段相关文字:

Some embedded content elements can have: content that is to be used when the external resource cannot be used (e.g. because it is of an unsupported format). The element definitions state what the fallback is, if any.


Due to the algorithm above, the contents of

object

elements act as fallback content, used only when referenced resources can't be shown (e.g. because it returned a 404 error). This allows multiple

object

elements to be nested inside each other, targeting multiple user agents with different capabilities, with the user agent picking the first one it supports.

但测试证明,没有浏览器在swf文件404时启用fallback content。

==

另外使用时要注意的一点:在浏览器支持flash的情况下(99%+?),除IE家族外,其他浏览器均会发起对替换图片的请求。

0
投稿

猜你喜欢

手机版 网络编程 asp之家 www.aspxhome.com