转载:http://www.iamued.com/qianduan/611.html
翻译自:http://www.permadi.com/tutorial/flashjscommand/index.html
重点在于 object的id属性 和 EMBED 的name属性 swliveconnect=”true” 属性
01
02
03
04
05
06
07
08
09
10
11
12
13
14
15
16
17
|
< OBJECT classid = "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/ shockwave/cabs/flash/swflash.cab# version = 6 ,0,0,0" WIDTH = "150" HEIGHT = "75" id = "simplemovie" ALIGN = "" > < PARAM NAME = movie VALUE = "simplemovie.swf" > < PARAM NAME = quality VALUE = medium > < PARAM NAME = bgcolor VALUE=#FFFFFF> < EMBED src = "simplemovie.swf" quality = medium swliveconnect = "true" bgcolor=#FFFFFF WIDTH = "150" HEIGHT = "75" name = "simplemovie" ALIGN = "" TYPE = "application/x-shockwave-flash" PLUGINSPAGE = "http://www.macromedia.com/go/getflashplayer" > </ EMBED > </ OBJECT > |
通过js获取flash对象的方法兼容表如下
通过上图得到JavaScript方法来获取flash对象 兼容多浏览器
01
02
03
04
05
06
07
08
09
10
11
12
13
14
15
16
|
function getFlashMovieObject(movieName) { if (window.document[movieName]) { return window.document[movieName]; } if (navigator.appName.indexOf( "Microsoft Internet" )==-1) { if (document.embeds && document.embeds[movieName]) return document.embeds[movieName]; } else // if (navigator.appName.indexOf("Microsoft Internet")!=-1) { return document.getElementById(movieName); } } |
获取到flash对象可以利用相关方法进行操作