AS 呼叫 JS 與 JS 呼叫AS

[[AS 呼叫 JS]]
AS

import flash.external.ExternalInterface;

_btn.addEventListener(MouseEvent.CLICK,function(e:Event){
ExternalInterface.call("AScallJS");
});
val_btn.addEventListener(MouseEvent.CLICK,function(e:Event){
ExternalInterface.call("AScallJSVal","我是參數");
});

JS

function AScallJS(){
alert("AS call JS");
}
function AScallJSVal(val){
alert("AS call JS,val="+val);
}
Category: ,

0 意見: