Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I notice two things right away</p> <p>firstly it appears your ExternalInterface will die if the ExternalInterface is not ready.</p> <pre><code>public function initApp():void { if (ExternalInterface.available) { ExternalInterface.addCallback("foobar", foobar); } } </code></pre> <p>I would add a timout and then try again so that it tries again until Externalinterface is ready.</p> <p>Also I don't see the function "foobar" in your javascript code. I see callback passed in as a variable but without varifying that it is in fact 'foobar' this is hte kind of thing that can make testing a misserable event.</p> <pre><code>function testAPICallbackFromGWT(callback){ $clinit_26(); //added by the GWT compiler alert('callback to be launched 3 2 1'); callback(); } </code></pre> <p>I would simplify your testing example so that there are less moving parts.</p> <pre><code>// e.g. run just flash to javascript only ExternalInterface.call("alert", "hello out there"); </code></pre> <p>if that works</p> <pre><code>// establish the call from flash ExternalInterface.addCallback("hello_out_there", foobar); // and in javascript alert(typeof('hello_out_there')); // will be 'function' if exists or undefined if ExternalInterface did not work </code></pre> <p>This way you can get a handle bit for bit what is working and where it breaks down.</p> <p>Pay atention to the timing, if you can tigger your flash from button actions and your javascript from links you can illiminate a number of loading issues as well. of course you'll need to solve an autoload version for your launch but for testing manually triggered events can simplify things significantly.</p> <p>also because it's javascript the browser is relevant.</p> <p>I've seen consistent results in Firefox and Internet explorer that break down in safari and sometimes IE is the odd browser out.</p> <p>Sometimes Firefox is the only one that breaks. </p> <p>you just have to test them all.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload