# Java ExternalInterface doesn't communicate with swf in Firefox & Safari

**URL:** <https://forum.kirupa.com/t/java-externalinterface-doesnt-communicate-with-swf-in-firefox-safari/312529>\
**Category:** flash\
**Created:** [August 5, 2010, 6:34pm UTC](https://forum.kirupa.com/t/java-externalinterface-doesnt-communicate-with-swf-in-firefox-safari/312529 "2010-08-05T18:34:33Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![stoniek](https://avatars.discourse-cdn.com/v4/letter/s/77aa72/32.png) [@stoniek](https://forum.kirupa.com/u/stoniek)\
**Post date:** [August 5, 2010, 6:34pm UTC](https://forum.kirupa.com/t/java-externalinterface-doesnt-communicate-with-swf-in-firefox-safari/312529/1 "2010-08-05T18:34:33Z")

</div>

I have two swf files: swf\_sender and swf\_receiver. The swf\_sender controls the swf\_receiver via java script.  
Everything works fine in IE however, the swf\_receiver doesn’t receive communication from java script if openned by Safari or Firefox.  
The first part of communication: swf\_sender - Java works ok (I tested it with alert() in Java) in all browsers.

Here is my Java interface code:

```auto
 
<script type="text/javascript">
 function getFlashMovie(movieName) {
  var isIE = navigator.appName.indexOf("Microsoft") != -1;
  return (isIE) ? window[movieName] : document[movieName];
 }
// call the sendTextToFlash function in AS3
 getFlashMovie("FlashName").sendTextToFlash("40");
</script>

```

Here is my AS3 code in swf\_receiver:

```auto

import flash.external.ExternalInterface;
function getTextFromJavaScript(FrameNumber:String):void {
 gotoAndPlay(FrameNumber);
}
ExternalInterface.addCallback("sendTextToFlash", getTextFromJavaScript);

```

I’d greatly appreciate any advice/ideas…
