1
我正在使用SWFObject 2.2在頁面中嵌入三個Flash影片,然後使用JavaScript的SetTimeout嘗試播放並使用ExternalInterface暫停影片。它在OS X上運行在Firefox和Safari上,但不在Windows上運行Firefox或Internet Explorer 8。 SWF嵌入正常,但不迴應播放或暫停。Windows上的Flash和ExternalInterface存在問題
var params = {
wmode: "transparent",
bgcolor: "#000000"
};
var attributes1 = {};
attributes1.id = "movie01_swf";
var attributes2 = {};
attributes2.id = "movie02_swf";
var attributes3 = {};
attributes3.id = "movie03_swf";
swfobject.embedSWF("movie_one.swf","movie01_movie","650","275","10.0.0",null,null,params,attributes1,null);
swfobject.embedSWF("movie_two.swf","movie02_movie","650","275","10.0.0",null,null,params,attributes2,null);
swfobject.embedSWF("movie_three.swf","movie03_movie","650","275","10.0.0",null,null,params,attributes3,null);
function pause_movie01(){
var movie01 = document.getElementById('movie01_swf');
movie01.pause();
}
function play_movie02(){
var movie02 = document.getElementById('movie02_swf');
movie02.play();
}
function pause_movie02(){
var movie02 = document.getElementById('movie02_swf');
movie02.pause();
}
function play_movie03(){
var movie03 = document.getElementById('movie03_swf');
movie03.play();
}
setTimeout("play_movie02()",3000);
setTimeout("pause_movie01()",4500);
setTimeout("play_movie03()",6000);
setTimeout("pause_movie02()",9000);
我還使用jQuery和easySlider爲頁面上的幻燈片設置動畫效果;電影嵌入在單獨的幻燈片上。
<ul>
<li>
<div class="movie"><div id="movie01_movie"></div></div>
</li>
<li>
<div class="movie"><div id="movie02_movie"></div></div>
</li>
<li>
<div class="movie"><div id="movie3_movie"></div></div>
</li>
</ul>
我得到JavaSript錯誤: play_movie02不是一個函數 play_movie03是不是一個功能 – kirkaracha 2011-01-05 21:45:06
你可以把一個預覽鏈接你的HTML和JS代碼,在那裏我可以看看會發生什麼請? – robertp 2011-01-05 23:24:24
嗨,夥計,你有沒有進一步解決這個問題? – robertp 2011-01-12 19:59:24