I can't get ExternalInterface.addCallback to work - trying to call an AS3 function from a js button
- by Guillaume Riesen
I'm trying to use ExternalInterface.addCallback to allow js to call an as3 method. My code is as follows:
AS:
ExternalInterface.addCallback("sendToActionscript", callFromJavaScript);
function callFromJavaScript():void{
circle_mc.gotoAndStop("finish");
}
JS:
Switch to square
function callToActionscript() {
flashController = document.getElementById("jstoactest")
flashController.sendToActionscript();
}
It's not working. What am I doing wrong?