Flash 到 javascript的通信----使用Flash的fscommand
Flash 到 Flash的通信----------使用本地连接对象或综合上2种技术
1.建立flash
a.用文字工具在舞台上创建一个文本域
b.选择这个文本域,在属性面板中,从下拉列表中选择动态文本(Dynamic Text),在变量(variable)栏填上"myVar"
c.保存
2.建立HTML
<SCRIPT LANGUAGE=javascript>
<!--
function doPassVar(args){
var sendText = args.value;
window.document.myFlash.SetVariable("myVar", sendText);
}
//-->
</SCRIPT>
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0"
height="100%" style=" 100%" id="myFlash">
<param name="movie" value="aaa.swf">
<param name="quality" value="high">
<param name="wmode" value="transparent">
<embed height="117" pluginspage="http://www.macromedia.com/go/getflashplayer" quality="high" src="aaa.swf" type="application/x-shockwave-flash" width="100%" wmode="transparent" name="myFlash" swLiveConnect="true">
</embed>
</object>
<input type="text" name="sendText" maxlength="45" onChange="doPassVar(this)">
<!--
function doPassVar(args){
var sendText = args.value;
window.document.myFlash.SetVariable("myVar", sendText);
}
//-->
</SCRIPT>
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0"
height="100%" style=" 100%" id="myFlash">
<param name="movie" value="aaa.swf">
<param name="quality" value="high">
<param name="wmode" value="transparent">
<embed height="117" pluginspage="http://www.macromedia.com/go/getflashplayer" quality="high" src="aaa.swf" type="application/x-shockwave-flash" width="100%" wmode="transparent" name="myFlash" swLiveConnect="true">
</embed>
</object>
<input type="text" name="sendText" maxlength="45" onChange="doPassVar(this)">
3.测试