Tags: ,.

AS代码如下:

function callMe(name:String):String
{
    return “busy signal”;
}
ExternalInterface.addCallback(”myFunction”, callMe);
则在html中可以通过如下方式来调用:
<script language=”JavaScript”>
    // result gets the value “busy signal”
    var result = flashObject.myFunction(”my name”);
</script>
…
<object id=”flashObject”…>
    …
    <embed name=”flashObject”…/>
</object>
这是flex doc中的官方example,但是在firefox下,如果你是动态的来生成object tag,则以上方式无效,需要改成:
var result = document[”flashObject”].myFunction(”my name”);

2条评论

  1. 博主的博客很不错啊,互踩一下,增加一下IP。多谢!

  2. 来看看,谢谢楼主

Post comment

comment has COPYRIGHT too!