How to execute code using ExternalInterface on page load?

I have been trying everything I can find to have code start on the window.onload event that uses callbacks exposed via the ExternalInterface. I’ve had many of the attempts working in IE, but Firefox is causing me grief.

I tried simply calling the code via an “onload=” statement in the body tag for starters, but that didn’t work because (I’m assuming) the Flash piece wasn’t loaded when onload was called. So I tried putting a line in the Flash that calls a javascript function once it’s loaded up. I tried this both by putting the ExternalInterface.call statement in a “this.onLoad=function(){” block as well as just putting the call at the end of the statements on frame 1 of my presentation (with a stop() on the frame) - either way it isn’t happening in Firefox.

I also tried using a setInterval in Javascript to test to see if one of the methods exposed via the ExternalInterface is an object (or not undefined). Once again, it’s working in IE, but not in Firefox. Here’s the code I’m using for that attempt:

==

var intCheckIfLoadedInterval=0;

function checkIfLoaded(){
//alert(thisMovie(“Media_Center”).setDefaultClip);
if(thisMovie(“Media_Center”).setDefaultClip!=undefined){
clearInterval(intCheckIfLoadedInterval);
mediaCenterStartupFunction();
}
}

function initMediaCenter(){
document.getElementById(‘mediaCenter’).style.top=" -700px";
document.getElementById(‘mediaCenter’).style.visib ility=“visible”;
intCheckIfLoadedInterval=setInterval(“checkIfLoaded()”,500);
}

window.onload=initMediaCenter();

==

Please let me know if you have any suggestions. The only other thing I can think of at the moment is using the swfObject for writing the flash tags to the page, but I’m already writing them from an external file (and removing the IE “Click to activate this control” issue in the process). All these methods work fine after the initial load (although I also had issues with Firefox when I simply try to call the onload instructions after a setTimeout command as well).

Thanks for your help.