ExternalInterface.call in Opera (ver. 12.01) doesn’t perform.
I’m using SWFObject.
In my index.php file in head-section:
swfobject.embedSWF("example.swf", "flash", "1", "1", "10.0.0");
JavaScript function in body:
function ready() {
alert();
}
Code in ActionScript 3:
if (ExternalInterface.available) {
ExternalInterface.call('ready');
}
In Google Chrome all works fine.
What may cause the problem in Opera?
Even Internet Explorer 7 works properly with this code.
It’s possible that the JavaScript
readymethod is unavailable when the Flash first attempts to call it. The Adobe documentation recommends polling the JavaScript until you get a result (see theExternalInterface.asexample here).You could test the theory quickly with something like the following:
Also,
JavaScript.alertis a fairly intrusive method of debugging. Try usingconsole.loginstead: