在Web 上部署flash
一、SWFObject嵌入Flash
使用SWFObject时,在HTML页面中需要包含以下3个要素:
1、<script>标签,用来包含SWFObject. 从SWFObject的WEB 页面上下载swfobject.js,把它放到自己的网站中。
2、<div>标签,
3、<script>快,创建SWFObject并在上面调用writer() 方法.
如:
<html><head>
<script type="text/javascript" src="swfojbect.js"></script>
<body>
<div id="content">
the html version of the flash content.
</div>
<script type="text/javascript">
var so=new SWFObject("demo.swf","domo","640","480","9","#000000");
so.addParam("wmode","transparent");
so.addVariable("age","26");
so.writer("content");
</script>
</body>
</html>
把参数wmode 的值设定为transparent,能够让flash的内容显示时,没有背景,于html的其它元素混合。
也就是flash以透明的方式显示。 但相对不透明方式,它要占用跟多资源。
二、使用object
如:
<object classid="clsid:d....>
<param name="movie" value="foo.swf">
<param name="quality" value="high">
</object>