This is a pretty bizarre situation; I’m hoping someone else here might have run across it.
I’m calling a Flash method from Javascript; the Flash movie is embedded in a <div> tag to make a layer which can be shown/hidden. In Firefox, all is well, no problem. In IE (6), it doesn’t work…unless I put an alert() call before the call to the Flash movie! Yes, it’s utterly bizarre.
Without the alert() call, I get the old “object doesn’t support method” error message. That’s obviously not true, so something is confusing IE and perhaps making it call the wrong object, or…something. As I said, this works perfectly in Firefox with or without the alert() call.
Here’s the code.
HTML: Nothing special here.
<div id=”flashLayer” align=”center”>
<table width=”100%” height=”100%” border=”0″ cellpadding=”0″ cellspacing=”0″>
<tr>
<td width=”100%” height=”100%” align=”center” valign=”middle”>
<div id=”flashcontent”>
You must have the Flash player installed to use this feature.
</div>
</td>
</tr>
</table>
</div>
Javascript: (using the FlashObject library to place the flash)
var fo = new FlashObject(“flashmovie.swf”, “flashMovie”, “585”, “242”, “8”, “#FFFFFF”);
fo.write(“flashcontent”);
var myMovie = document.getElementById(“flashMovie”);
function sendToFlash(txt) {
MM_showHideLayers(‘flashLayer’,”,’show’); // display the layer
alert(“Hi there!”) // **** If this is there, it works in IE; if not, it doesn’t work
myMovie.sendText(txt); // call Flash method
}
Thanks for any help, if anyone’s run across this before!!