2009-08-31 53 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变量中。