如何在Firefox中使用JavaScript播放Flash电影 [英] How to Play a Flash Movie with JavaScript in Firefox
本文介绍了如何在Firefox中使用JavaScript播放Flash电影的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
< head>
< script language =JavaScript>
<! -
function startFlash()
{
document.getElementById(movie)。
}
- >
< / script>
< / head>
< body onLoad =startFlash()>
...
< object ... id =movie>
< embed ... name =movie>
...
:
window.document [movie]。Play();
没有运气。有任何想法吗?我现在可以不太在乎Safari和Chrome,但是我必须拥有Firefox兼容性!谢谢。
解决方案
Adobe推荐这段代码:
function thisMovie(movieName){
if(navigator.appName.indexOf(Microsoft)!= -1){
return window [movieName];
} else {
return document [movieName];
function startFlash(){
thisMovie(movie)。play();
}
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.
解决方案
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();
}
这篇关于如何在Firefox中使用JavaScript播放Flash电影的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文