ExternalInterface help

I’m trying to have two flash menus talk to one another via ExternalInterface, but for whatever reason the javascript function isn’t being called.

I have two menus, topMenu and tabMenu. The idea is for clicking on one to, among other things, send a message to the other.

First, the JavaScript:


<script type="text/javascript">

swfobject.registerObject("tab", "9.0.0");
swfobject.registerObject("topMenu", "9.0.0");

window.onload = function () {
  var tabMenu = swfobject.getObjectById("tab");
  var topBit = swfobject.getObjectById("topMenu");  
}

function goBetween (msg) {
  if (msg == "top") {        // top is selected
    tabMenu.asCommunicator();
    alert('ok');
  } else if (msg == "side") {    // side is selected
    topBit.asCommunicator();
  }
}

</script>

Now, the relevant AS in tabMenu:


import flash.external.ExternalInterface;
ExternalInterface.addCallback("asCommunicator", this, asCommunicator);
function asCommunicator():Void {
    _root.clicked = "other";
    for (i in menuArray) {
        menuArray*.gotoAndStop(1);
    }
}

Finally, the code in topBit:


import flash.external.ExternalInterface;
// on a movieClip:
onClipEvent (load) {
    this.onRelease = function () {
        ExternalInterface.call(goBetween, "top");
    }
}

Obviously I haven’t put the code in for two-way communication, but I want to get this working. As of now, clicking the button on topBit does absolutely nothing. No errors from Firebug, and the alert doesn’t come up, so goBetween() isn’t being called.

Any ideas?