call as3 function from javascript use swfobject

2011年5月3日 星期二 by Hu, Ching-Hsiang

JS code

var flashObj = document.getElementById("flash_id");// must have real ID you passed to SWFObject
flashObj.getFromJavaScript();


AS3 code

import flash.external.ExternalInterface;
ExternalInterface.addCallback("getFromJavaScript", anActionScriptMethod);
function anActionScriptMethod():void{
//do something
}

Filed under having  

0 意見: