I want to call a JS function from within an object that is passed to flash.
JS code:
<script>
function initContext() {
flashMovie.setContext(ctx);
}
var ctx = new Object();
ctx.saySomething = function(msg) {
alert(msg);
}
</script>
AS3 code:
if (ExternalInterface.available) {
ExternalInterface.addCallback("setContext", say);
ExternalInterface.call("initContext");
}
So first AS3 calls JS initContext and JS initContext then calls setContext with an object. So far this works. I am stuck at how to call the function saySomething from the passed object:
private function say(context:Object) {
ExternalInterface.call(???);
}