如果想在网页中嵌入flash,可以通过一下代码来实现:
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="800" height="600">
<param name="movie" value="main.swf" />
<param name="quality" value="high" />
<embed src="main.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="800" height="600"></embed>
</object>
标红的是文件名,上面的例子是跟html文件在同目录下的,也可以不在同目录。上面的代码将调用main.swf这个flash文件。
但是我的main.swf里面用actionscript定义了两个变量,需要通过html传递两个值给main.swf,然后显示不同的内容。
在<param name="movie" value="main.swf" />后面加入一行代码<param name="flashVars" value="pic=5&word=2" />,可以将pic和word这两个变量传到flash里面,在flash中的actionscript中通过_root.pic 和 _root.word 可以得到这两个变量的值。
测试,IE下成功,firefox下失败。
经过网上查找资料,发现IE是读param标签中name为flashVar的值,但是firefox是读embed标签的值,所以应该把 flashVars="pic=5&word=2" 这段代码加到embed标签末尾,即:
<embed src="main.swf" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="800" height="600" flashVars="pic=5&word=2"></embed>
ok,IE&firefox都成功。
This blogger is recording some code samples,technical skill of java,.Net,javascript, css, html for myself use. All articles are coming from my own experience and my collections which are from internet world. If you find any material have copy right issue please leave a comment to me. I will delete it immediately. These articles are writing in English or Chinese. Hope these information can help other technical guys. Thanks for reading.
Subscribe to:
Post Comments (Atom)
-
If you get "This page calls for XML namespace http://richfaces.org/a4j declared with prefix a4j but no taglibrary exists for that names...
-
Method 1: import oracle.sql.*; public class JClob { String tableName = null; // String primaryKey = null; // String primaryValue = null; // ...
-
1.HTTP-binding(ServiceMix) 1.4 各组件间传递消息流的过程如下: 1. HttpClient : Http 客户端运行一个独立的 Java 客户端程序,通过其中的 URLConnection 类连接到 http://...
No comments:
Post a Comment