我Flash中的一个函数为
import flash.external.ExternalInterface;
ExternalInterface.addCallback("Hello", this, Hello);function Hello()
{
return "Ok";
}页面为:<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<title></title>
<style type="text/css">
body {
border-style: none;
}
</style>
<meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">
<meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">
<script language="javascript">
function thisMovie(movieName) 
{
if (navigator.appName.indexOf("Microsoft") != -1)
{
return window[movieName]
}
else
{
return document[movieName]
}
}
function OnRemoteCmd(nKeyCode)
{
switch(nKeyCode)
{
case 37:
if (window.document.index5!=null)
{
alert(nKeyCode);
var re=thisMovie("index5").Hello;
alert(re);
}
break;
}
}
</script>
</head>
<body bottomMargin="0" leftMargin="0" topMargin="0" scroll="no" rightMargin="0" onLoad="document.body.focus();">
<input type="button" onClick="OnRemoteCmd(37)" value="Test">
<P><FONT face="宋体">
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0"
width=100% height=100% id="index5">
<param name=movie value="index5.swf">
<param name=quality value=high>
<embed src="index5.swf" quality=high width=100% height=100% type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" name="index5" swLiveConnect="true">
</embed> 
</object>
</FONT>
</P>
</body>
</html>为什么调用总是不成功?这句var re=thisMovie("index5").Hello;是执行了的,但下边那句alert(re)出来内容是undefined,搞了一天了,都没弄明白怎么回事,所以找大家帮忙了