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?
tried the same! works for me. Make sure your addEventListener code inside a function like creation complete. it should be.
Also look at http://code.google.com/p/flash-thunderbolt/