# F8|AS2 ExternalInterface AddCallback not working - Help!

**URL:** <https://forum.kirupa.com/t/f8-as2-externalinterface-addcallback-not-working-help/255087>\
**Category:** flash\
**Created:** [March 18, 2008, 10:10pm UTC](https://forum.kirupa.com/t/f8-as2-externalinterface-addcallback-not-working-help/255087 "2008-03-18T22:10:27Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Porton](https://avatars.discourse-cdn.com/v4/letter/p/22d042/32.png) [@Porton](https://forum.kirupa.com/u/Porton)\
**Post date:** [March 18, 2008, 10:10pm UTC](https://forum.kirupa.com/t/f8-as2-externalinterface-addcallback-not-working-help/255087/1 "2008-03-18T22:10:27Z")

</div>

I have never posted to this forum before but I am about to pull my hair out. Please help.

I’ve created a page that used External Interface before with no problems and I can’t figure out what makes this one different. It works fine on both Firefox and Safari on a Mac. On a pc, however, the Flash has no problem calling JavaScript functions but the JavaScript can’t call the ActionScript function. It doesn’t matter if I try Firefox, IE7 or IE6. The error IE gives is that the object doesn’t support the property or method.

Here is the AS:

```auto
this.createEmptyMovieClip("samplework_mc", 999);

function loadWork(workname:String):Void {
    loadMovie(workname, samplework_mc);
    samplework_mc._x=0;
    samplework_mc._y=0;
}

ExternalInterface.addCallback("loadWork", this, loadWork);

```

[FONT=Courier New]

[FONT=Verdana]Here is the HTML/JS:  
[/FONT][/FONT]

```auto
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<style>.popup { position: absolute; visibility: hidden; width: 200; z-index: 20 }</style>
<script type="text/javascript" src="swfobject.js"></script>
<script type="text/javascript">
// <![CDATA[
    function thisMovie(movieName) {
        var isIE = navigator.appName.indexOf("Microsoft") != -1;
        return (isIE) ? window[movieName] : document[movieName];
    }
    function changePop(str) {
        thisMovie("flashpopup").loadWork(str);
    }
    function viewPop(str) {
        changePop(str);
        document.getElementById('example1').style.visibility='visible'
    }
    function hidePop() {
        document.getElementById('example1').style.visibility='hidden';
    }
    // ]]>
</script>
</head>

<body bgcolor="#ffffff">
<div id="flashcontent" style="z-index:10; position:absolute;"></div>
<script type="text/javascript">
    // <![CDATA[
    var so = new SWFObject("thumbnails.swf", "thumnails", "750", "350", "8", "#d5d3a7");
    so.addParam("wmode", "transparent");
    so.addParam("allowScriptAccess", "always");
    so.write("flashcontent");
    // ]]>
</script>

<div class="popup" id="example1"></div>
<script type="text/javascript">
    // <![CDATA[
    var so = new SWFObject("flashpopup.swf", "flashpopup", "800", "500", "8", "#d5d3a7");
    so.addParam("wmode", "transparent");
    so.addParam("allowScriptAccess", "always");
    so.write("example1");
    // ]]>
</script>
    
</body>
</html>

```

[FONT=Courier New][FONT=Verdana]  
[/FONT][/FONT]  
I would be grateful for any help or suggestions. I can post the FLA(s) if anyone wants to see them. Thanks!

---

<div class="post-metadata">

**Author:** ![nathan99](https://avatars.discourse-cdn.com/v4/letter/n/96bed5/32.png) [@nathan99](https://forum.kirupa.com/u/nathan99)\
**Post date:** [June 22, 2008, 9:44am UTC](https://forum.kirupa.com/t/f8-as2-externalinterface-addcallback-not-working-help/255087/2 "2008-06-22T09:44:32Z")

</div>

I know this is old. But I’m having the same problem. Anyone have any ideas?
