You can pass all sorts of JavaScript code into the first parameter of
ExternalInterface.call()
, not just names of already existing functions. Ie. you can inject your own JavaScript code into the HTML page that contains the Flash object. And to make life easier, you can embed the JavaScript code as XML.
Eg.
var JS: XML =
<![CDATA[
function() {
if (typeof(myGlobalFunction) == "undefined") {
myGlobalFunction = new function(text) {
alert(text);
}
}
}
]]>
if (ExternalInterface.available) {
ExternalInterface.call(JS);
ExternalInterface.call("myGlobalFunction", "Hello World!");
}
Recent comments
2 years 34 weeks ago
4 years 3 weeks ago
4 years 3 weeks ago
4 years 5 weeks ago
4 years 6 weeks ago
4 years 13 weeks ago
4 years 13 weeks ago
4 years 13 weeks ago
4 years 13 weeks ago
4 years 14 weeks ago