<script language="JavaScript" type="text/jscript">
function UserShow()
{thisMovie("Player").flAlert("hello"); //这一句报错.}
function thisMovie(movieName) {
if (navigator.appName.indexOf("Microsoft") != -1){
return window[movieName];
} else {
return document[movieName];
}
}</script> 我是用FLASH AS3写的,写的是一个播放器,我要把"HELLO" 用JS 传给"player" 这一句老是报错,我在本地电脑调试没有问题,说明语句没有写错,可是我一上传到网站上就出现在了这个问题.对象不支持此属性或方法
function UserShow()
{thisMovie("Player").flAlert("hello"); //这一句报错.}
function thisMovie(movieName) {
if (navigator.appName.indexOf("Microsoft") != -1){
return window[movieName];
} else {
return document[movieName];
}
}</script> 我是用FLASH AS3写的,写的是一个播放器,我要把"HELLO" 用JS 传给"player" 这一句老是报错,我在本地电脑调试没有问题,说明语句没有写错,可是我一上传到网站上就出现在了这个问题.对象不支持此属性或方法
var player = thisMovie("Player");
player.flAlert("hello");
建议先加判断,如果没有加载完成用settimeout过段时间后再读。function thisMovie(movieName) {
if (navigator.appName.indexOf("Microsoft") != -1) {
return window[movieName]
}else {
return document[movieName]
}
}
function callflash(msg){
try{
thisMovie("mymovie").flAlert(msg);
}catch(e){
setTimeout(function(){callflash(msg);},100);
}
}