[問題] 如何從js call as裡的函數動作

看板Flash作者 (Ramone)時間13年前 (2010/10/05 11:52), 編輯推噓1(100)
留言1則, 1人參與, 最新討論串1/1
這個問題卡了一天還是找不出結果 我在.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
好像要用swfobject.js的外掛 把FLASH崁入 才讀的到
10/05 19:29, 1F
文章代碼(AID): #1Cgg4LJJ (Flash)