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

1k views Asked by At

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.call("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?

3

There are 3 answers

3
Justin Putney On

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

allowScriptAccess="always"
0
Alex Hofsteede On

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>.

1
Zunandi On

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.