Hello,
I followed this guide to create a new a js to flash communication: http://www.actionscript.org/resources/articles/638/1/Basics-of-using-the-ExternalInterface/Page1.html
So my code looks like:
function getID( swfID ){
if(navigator.appName.indexOf("Microsoft") != -1){
me = window[swfID];
}else{
me = document[swfID];
}
}
function js_to_as( str ){
me.onChange(str);
}
Now sometimes, my onChange does not load, but currently, firebug displays a "me.onChange is not a function" error and completely stops. I want it to degrade gracefully because this is not the most important feature in my program. I tried typeof but that still gives the same error.
Any suggestions on how to make sure that it exists and then only execute onChange?
Thank you for your time.
UPDATE None of the methods below except try catch one work.