所属分类:HTML网页,JS语言与代码
http://blog.csdn.net/qq_16490557/articl ... s/36172513
[code]-------------------------------------------------ActionScript----------------------------------------------------------------------------- import flash.external.*; //注册命名控件 var methodName:String="sender"; //JS回调函数 var instanceL:Object=null; var method:Function=receive; //FLASH接收函数 var vBoll=ExternalInterface.addCallback (methodName, instance, method); //FLASH注册 function receive(msg:String) { TT.text="ab"; } TT.text=vBoll;
------------------------------------------------JavaScript-------------------------------------------------------------------------------- document.getElementById('as_js').sender('ab'); //JS调用Flash[/code]
[code]-------------------------------------------------ActionScript----------------------------------------------------------------------------- import flash.external.*; //注册命名控件 var methodName:String="sender"; //JS回调函数 var instanceL:Object=null; var method:Function=receive; //FLASH接收函数 var vBoll=ExternalInterface.addCallback (methodName, instance, method); //FLASH注册 function receive(msg:String) { TT.text="ab"; } TT.text=vBoll;
------------------------------------------------JavaScript-------------------------------------------------------------------------------- document.getElementById('as_js').sender('ab'); //JS调用Flash[/code]