[問題] 如何從js call as裡的函數動作
這個問題卡了一天還是找不出結果
我在.fla檔放了以下程式
import flash.external.ExternalInterface;
if( ExternalInterface.available ){
ExternalInterface.addCallback("usefunction",flashHello);
}
function flashHello():void{
b1.play();
trace("hello");
}
然後網頁檔裡放了js
<script>
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 obj = getFlashMovieObject("ma1");
if(obj)
obj.usefunction();
</script>
我的目標是在html執行某項動作 像是關閉網頁
可以去執行flash裡的function
照理說應該會去執行 flash 裡的函數usefunction 但沒有~"~
應該怎麼做呢??
原始檔 : http://www.badongo.com/file/24279537
甘溫
--
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 122.116.102.153
推
10/05 19:29, , 1F
10/05 19:29, 1F