开发者

externalinterface.call won't call the JavaScript function - Firefox 3.6

I have a function defined in JavaScript like so:

function fadeBack() {
    alert("fadeBack called");
};

I call that function from my Flash file like so:

import flash.external.*;
flash.external.ExternalInterface.c开发者_如何学Goall("fadeBack");

This works in both Safari and Chrome, but for some reason Firefox won't ever call the function. Still, I can't figure this out. How can I fix it?


Make sure you have the following parameter set in your HTML or JS embed:

allowScriptAccess="always"


I had the identical problem in Firefox. After I updated to FireFox 6.02, the problem went away - your code should work fine in version 6.02. I cannot confirm in which version of Firefox this issue was resolved.


This could be due to the lack of an <embed> tag. If you are using SWFObject 2, it no longer adds the <embed> tag inside the <object> tag. I believe that using ExternalInterface in Firefox requires the <embed>.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜