actionscript 3 - AS3 method call to javascript + NO SERVER COMMUNICATION -
code below jscript, believe don't have error on integrating code.
<script type="text/javascript" src="./js/swfobject.js"></script> <script type="text/javascript"> var flashvars = {}; var params = {}; params.allowscriptaccess = "always"; params.allownetworking = "all"; var attributes = {}; attributes.id = "map-moa"; swfobject.embedswf("./video/map.swf?v=1.3", "map-moa", "1560", "980", "9.0.0", false, flashvars, params, attributes); </script> $(".goto-path").on("click",function(){ // alert("goto booth #"+$(this).data('booth_id')); sendtexttoas3(); // call flash (as3) method }); function sendtexttoas3(){ var isie = navigator.appname.indexof("microsoft") != -1; var flash = (isie) ? window["map-moa"] : document["map-moa"]; console.log(flash) try{ flash.samplemethod(); }catch(e){ console.log(e) } }
i having error undefined method yet function declared in as3 class.
public function main():void { externalinterface.addcallback("samplemethod", callbackid); } public function callbackid():void { trace(this, "test"); }
Comments
Post a Comment