Problem with Flash and ExternalInterface on Windows
I'm using SWFObject 2.2 to embed three Flash movies on a page, then using JavaScript's SetTimeout to try to play and pause the movies with ExternalInterface开发者_运维技巧. It's working in Firefox and Safari on OS X, but not in Firefox or Internet Explorer 8 on Windows. The SWFs embed fine, but don't respond to play or pause.
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);
I'm also using jQuery and easySlider to animate slides on the page; the movies are embedded on separate slides.
<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>
I think there might be a Javascript error you don't see. Have you tried tracking JS errors with any tools like Firebug for Firefox?
精彩评论