I have a Flash game which send and receive lot of messages from JavaScript. Sometimes I need to stop listening some of those functions, but ExternalInterface doesn't have a removeCallback function. So I'm doing somthing ugly: using a boolean to validate if a callback is available in each function.
Any better solution?
ExternalInterface.addCallback("callAlert", callAlert);
function callAlert(msg:String){
if(callAlertAvailable){
//...
}
}
Just call again addCallback, setting the function as null:
Why not read the docs? I found it here:
ExternalInterface.addCallback()