用js嵌入flash动画
时间: 2023-09-15 22:21:31 浏览: 85
在JS中嵌入Flash动画有两种方式:
1. 使用<object>标签
可以使用<object>标签来嵌入Flash动画。例如:
```html
<object type="application/x-shockwave-flash" data="your_flash_file.swf" width="800" height="600">
<param name="movie" value="your_flash_file.swf">
<param name="quality" value="high">
<param name="bgcolor" value="#ffffff">
</object>
```
其中,type属性指定了嵌入的文件类型;data属性指定了Flash动画文件的路径;width和height属性分别指定了动画的宽度和高度;param标签中的name和value属性可以设置Flash动画的参数。
2. 使用<embed>标签
另一种方式是使用<embed>标签来嵌入Flash动画。例如:
```html
<embed src="your_flash_file.swf" quality="high" bgcolor="#ffffff" width="800" height="600" type="application/x-shockwave-flash">
```
其中,src属性指定了嵌入的文件路径;quality属性指定了动画的质量;bgcolor属性指定了背景色;width和height属性分别指定了动画的宽度和高度;type属性指定了文件类型。
需要注意的是,不同浏览器对<object>和<embed>标签的支持有所不同,建议使用<object>标签来嵌入Flash动画。
阅读全文
相关推荐















