开发者

Flash backup image

so I have a pretty big flash file on my homepage, which raises a few issues abo开发者_如何学运维ut what to do if the user doesn't have flash player installed on his/her PC.

I would like to make sure that if the user has a old version of flash player, or doesn't have it at all, a backup image will display in place of the flash, how can I accomplish that?

Iss Javascript or jquery an option?


The best choice, IMHO, is to use swfobject

It will handle both issues:

  1. Users with Javascript disabled will get whatever alternate content you have for them
  2. Users with an older version of Flash installed will be prompted to download a newer version (expressInstall.swf)

Example Code:

<div id='myFlashMovie'>This text or image will be replaced if the user has the correct version of Flash</div>
<script type="text/javascript">
    var flashvars = {};
    var params = {'allowfullscreen':'true', 'allowscriptaccess':'always', 'wmode':'opaque', 'bgcolor':'#000'};
    var attributes = {'name':'movie'};
    swfobject.embedSWF("path/to/flash/movie.swf", "myFlashMovie", "640", "410", "9.0.0","expressInstall.swf", flashvars, params, attributes);
</script>


Have a look at swfobject. It is the recommended method for embedding Flash into your webpage, and comes with all of the options you mentioned included.


Without JS and if no support:

<object.....><img src="noflash.gif" /></object>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜