flash js调用as 未执行 求解
本帖最后由 SilverNet 于 2011-10-11 11:18:55 编辑 //js 中
function btnC(){
thisMovie("myFlash").say();
}
function btnB(){
thisMovie("myFlash").checkName("哈哈",25)
}
function thisMovie(movieName) {
if (navigator.appName.indexOf("Microsoft") != -1) {
return window[movieName];
} else {
return document[movieName];
}
}
(function ($) {
$(document).ready(function () {
// 此处 FF 谷歌 会失效 只有IE会执行
thisMovie("myFlash").say();
//alert(thisMovie("myFlash").checkName("哈哈",25));
//getFlashMovieObject("myFlash").say();
//使用setTimeout 来实现 - 这样可以实现FF和谷歌调用 - 不过这个时间就有待商榷了
setTimeout(btnC,2000);
//setTimeout(btnB,2000);
});
})(jQuery);
ExternalInterface.addCallback("say",getUserInfo);
ExternalInterface.addCallback("checkName",getCheckName);
//html object
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="300" height="100" id="myFlash">
<param name="movie" value="music.swf" />
<param name="allowScriptAccess" value="always" />
<param name="allowNetworking" value="all" />
<param name="allowFullScreen" value="true" />
<embed src="music.swf" quality="high" bgcolor="#ffffff" width="300" height="100" name="myFlash" swLiveConnect="true" align="middle" allowScriptAccess="always" allowNetworking="all" allowFullScreen="true" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
</object>