Reputation: 107
I have found a way to send a play(); command to my Flash movie in IE9 but I can't figure it out in Firefox9. Here is the code I am using that works in IE:
<head>
<script language="JavaScript">
<!--
function startFlash()
{
document.getElementById("movie").Play();
}
-->
</script>
</head>
<body onLoad="startFlash()">
...
<object... id="movie">
<embed... name="movie">
...
I tried using: window.document["movie"].Play();
no luck. Any ideas? I could care less about Safari and Chrome for now, but I have gotta have Firefox compatibility! Thanks.
Upvotes: 0
Views: 2836
Reputation: 5978
Adobe recommends this code:
function thisMovie(movieName) {
if (navigator.appName.indexOf("Microsoft") != -1) {
return window[movieName];
} else {
return document[movieName];
}
}
function startFlash() {
thisMovie("movie").play();
}
Upvotes: 1