2011-11-11 35 views
0

大家好,我猜我一直很愚蠢,但我一直在試圖弄清楚這一點,我是新的js我需要幫助如何從JavaScript函數執行下面的代碼時,身體卸載這是一個Flash功能,但我希望它從一個JS功能執行請幫助。從javascript執行的Flash函數

 public function save():Boolean { 
     ExternalInterface.call(this.eventHandler, RecorderJSInterface.SAVE_PRESSED,  this.recorder.currentSoundName); 
     try { 
     _save(this.recorder.currentSoundName, this.recorder.currentSoundFilename); 
     ExternalInterface.call(this.eventHandler, RecorderJSInterface.SAVING, this.recorder.currentSoundName); 
     } catch(e:Error) { 
     ExternalInterface.call(this.eventHandler, RecorderJSInterface.SAVE_FAILED, this.recorder.currentSoundName, e.message); 
     return false; 
     } 
     return true; 
     } 
+0

任何人的幫助球員請 – pumba

回答

0

好吧,這是我的代碼從javascript調用閃光功能:

<script language="JavaScript"> 
function thisMovie(movieName) { 
    if (navigator.appName.indexOf("Microsoft") != -1) { 
     return window[movieName]; 
    } else { 
     return document[movieName]; 
    } 
} 
function setData(value) { 
    thisMovie("yourmovie").save(); 
} 
</script> 

而且你必須有你的電影嵌入這樣的:

<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" 
     id="yourmovie" width="200" height="200" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab"> 
    <param name="movie" value="yourmovie.swf" /> 
    <param name="quality" value="high" /> 
    <param name="allowScriptAccess" value="sameDomain" /> 
    <embed src="yourmovie.swf" quality="high" 
     width="200" height="200" name="yourmovie" align="middle" 
     play="true" loop="false" quality="high" allowScriptAccess="sameDomain" 
     type="application/x-shockwave-flash" 
     pluginspage="http://www.macromedia.com/go/getflashplayer"> 
    </embed> 
</object>