I'm trying to do a very simple test to get the AS3 ExternalInterface.call() to Javascript console.log() for me.
I have a simple SWF with AS3 on a top layer and a button that triggers the call.
import flash.external.ExternalInterface;
function log(message:String):void
{
trace (message);
if (ExternalInterface.available)
{
ExternalInterface.call('console.log', message);
}
}
button.addEventListener(MouseEvent.CLICK,button_click);
function button_click(e:MouseEvent):void
{
log("Hello World");
}
I have tested this in the Flash IDE to make sure the button click is tracing and it is. I've been testing this in both the latest Chrome and Firefox browser.
Am I doing something fundamentally wrong?
I'm trying to do a very simple test to get the AS3 ExternalInterface.call() to Javascript console.log() for me.
I have a simple SWF with AS3 on a top layer and a button that triggers the call.
import flash.external.ExternalInterface;
function log(message:String):void
{
trace (message);
if (ExternalInterface.available)
{
ExternalInterface.call('console.log', message);
}
}
button.addEventListener(MouseEvent.CLICK,button_click);
function button_click(e:MouseEvent):void
{
log("Hello World");
}
I have tested this in the Flash IDE to make sure the button click is tracing and it is. I've been testing this in both the latest Chrome and Firefox browser.
Am I doing something fundamentally wrong?
Share Improve this question asked Jul 14, 2011 at 16:20 user463112user4631121 Answer
Reset to default 3tried the same! works for me. Make sure your addEventListener code inside a function like creation plete. it should be.
Also look at http://code.google./p/flash-thunderbolt/