2009-08-31 50 views

回答

2

您可以使用ExternalInterface.call。

import flash.external.ExternalInterface; 


ExternalInterface.call('update', id); 
+0

這導致沒有結果......我使用CS3和按鈕處理程序工作,但沒有任何事情發生。任何理由嗎? – 2011-05-02 23:36:45

0
<script> 
function displayCurrentTime() 
{ 
var date = new Date(); 
return date.toLocaleTimeString(); 
} 
</script> 

你可以調用這個函數就好像你總是會,而只是把它就像你將任何其他類型的您存儲返回的值作爲一些變量的一部分吸氣功能:

var currentTime:string = ExternalInterface.call("displayCurrentTime()"); 

當此代碼運行時,Flash將調用displayCurrentTime JavaScript函數並將返回值存儲在currentTime變量中。