js调用flash function 的方法

代码
 
   

< html >
< head >
< meta http-equiv ="Content-Type" content ="text/html; charset=gb2312" /> < title > call flash function </ title >
< script language =javascript >
function test()
{
  
var str = document.getElementById( ' main ' ).back(); alert(str);
}
</ script >
</ head > < body >
< object classid ="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" id ="main" codebase ="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab" >
< param name ="movie" value ="main.swf" />
< param name ="wmode" value ="transparent" >
< param name ="quality" value ="high" />
< param name ="bgcolor" value ="ffffff" />
< param name ="allowScriptAccess" value ="always" />
< embed src ="test.swf" quality ="high" bgcolor ="ffffff" width ="217" height ="24" name ="upload" align ="middle" play ="true" wmode ="transparent" loop ="false" quality ="high" allowScriptAccess ="sameDomain" type ="application/x-shockwave-flash" pluginspage ="http://www.adobe.com/go/getflashplayer" >
</ embed >
</ object >
</ body >
</ html >

 



flash 方法:

<?xml version="1.0" encoding="utf-8"?>
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="initApp()">
<mx:Script>
<![CDATA[
import mx.controls.Alert;
import flash.external.ExternalInterface;

public function initApp():void {
ExternalInterface.addCallback("back",back);
ExternalInterface.call("test");
}

public function back():String {
return "back";
}
]]>
</mx:Script>
</mx:Application>












 

转载于:https://www.cnblogs.com/dasn/articles/1911196.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值