I followed this guide to create a new JS to flash communication.(我按照本指南创建了一个用于通讯的新JS。)
My code is(我的代码是)function getID( swfID ){
if(navigator.appName.indexOf("Microsoft") != -1){
me = window[swfID];
}else{
me = document[swfID];
}
}
function js_to_as( str ){
me.onChange(str);
}
However, sometimes my onChange
does not load.(但是,有时我的onChange
无法加载。) Firebug errors with(萤火虫错误)
me.onChange is not a function(me.onChange不是一个函数)
I want to degrade gracefully because this is not the most important feature in my program.(我想优雅地降级,因为这不是我程序中最重要的功能。) typeof
gives the same error.(typeof
给出相同的错误。)
Any suggestions on how to make sure that it exists and then only execute onChange
?(关于如何确保它存在然后仅执行onChange
任何建议?)
(None of the methods below except try catch one work)((以下任何一种方法都不能尝试抓到一件作品))
ask by Alec Smart translate from so