Is there any way to make javascript recognize that function registered at actionscript with ExternalInterface.addCallback was removed by calling it again and passing null to closure reference?
I have this code at actionscript:
ExternalInterface.addCallback(functionName, myFunction);
At javascript I try to find out type of function registered:
var flashContent = document.getElementById("flashContent");
console.log(typeof flashContent.functionName);
Which produce following ouput at console:
function
Then I remove callback at actionscript by calling:
ExternalInterface.addCallback(functionName, null);
But calling previous javascript check again:
console.log(typeof flashContent.functionName);
Produces the same output again:
function
Note that if I call this check before creating callback ExternalInterface.addCallback function I get output:
undefined
I needed to call some functions in flash content. But some functions might become unavaiable depending on state of our flash content.
I made workaround: Created "check" function on flash that is always avaiable to js.
Javascript can then easily know if any function on flash is avaiable just by calling this "check" function first and passing desired function's name.