JS与Flash通讯早在多年以前就不是问题,但是因为微软的补丁,AS2到AS3的升级,加上一些focusFlash、swfObject的出现,再加上ExternalInterface的绑定。将Flash、JS、Flash的通讯搞的乱七八糟了。
再加上浏览器越来越多,想要完美的支持Flash与页面通讯,已经变得比兼容CSS更麻烦了。
Adobe自己官方的教程都不能满足ExternalInterface的正常运行。正确获得FLash Object都不能看CS3的Help了。
function getFlashMovieObject(movieName){
if (window.document[movieName]){
return window.document[movieName];
}
if (navigator.appName.indexOf("Microsoft Internet")==-1){
if (document.embeds && document.embeds[movieName]){
return document.embeds[movieName];
}
}else{
return document.getElementById(movieName);
}
}
再加上浏览器越来越多,想要完美的支持Flash与页面通讯,已经变得比兼容CSS更麻烦了。
Adobe自己官方的教程都不能满足ExternalInterface的正常运行。正确获得FLash Object都不能看CS3的Help了。
function getFlashMovieObject(movieName){
if (window.document[movieName]){
return window.document[movieName];
}
if (navigator.appName.indexOf("Microsoft Internet")==-1){
if (document.embeds && document.embeds[movieName]){
return document.embeds[movieName];
}
}else{
return document.getElementById(movieName);
}
}
之前出现过:
var isIE=(typeof window.ActiveXObject != 'undefined')?true:false;
官方的:
function thisMovie(movieName) {
if (navigator.appName.indexOf("Microsoft") != -1) {
return window[movieName];
} else {
return document[movieName];
}
}
var isIE=(typeof window.ActiveXObject != 'undefined')?true:false;
官方的:
function thisMovie(movieName) {
if (navigator.appName.indexOf("Microsoft") != -1) {
return window[movieName];
} else {
return document[movieName];
}
}

FMS2 最近使用的笔记


return document[movieName] || window[movieName]
}
足以~