/    Sign up×
Community /Pin to ProfileBookmark

Problems calling Flash in IE browser

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!!

to post a comment
JavaScript

0Be the first to comment 😎

×

Success!

Help @mason spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.2,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,
)...