1、让html页面中插入的flash在IE和FireFox都可以显示
IE和Firefox都兼容
<object id="flash1" data="Flash-VII.swf" type="application/x-shockwave-flash" width="100%" height="100%">
<param name="movie" value="Flash-VII.swf" />
<param name="wmode" value="transparent"/>
</object>
2、flash onclick
在object上添加onclick事件是不会生效的,只能另辟蹊径:
<span οnmοusedοwn="gotoDetaultPage()" style="cursor: hand;" title="click to skip this movie / 点击跳过动画">
<object id="flash1" data="Flash-VII.swf" type="application/x-shockwave-flash" width="100%" height="100%">
<param name="movie" value="Flash-VII.swf" />
<param name="wmode" value="transparent"/>
</object>
</span>
3、判断flash 播放完毕
<html>
<head>
<title>test page</title>
<script>
function gotoDetaultPage(){
location.href='default2.html';
}
function getFlashMovieObject(movieName) {
if (window.document[movieName]){
return window.document[movieName];
}
if (navigator.appName.indexOf("Microsoft Internet")==-1){
if (document.embeds && document.embeds[movieName]){
return document.embeds[movieName];
}
}else{ //if (navigator.appName.indexOf("Microsoft Internet")!=-1){
return document.getElementById(movieName);
}
}
window.οnlοad=function(){
//alert('start');
setInterval("checkOver()", 500);
}
var globalCurrent = 0;
var lastCurrent = 0;
function checkOver(){
var movie = getFlashMovieObject("flash1");
//alert(movie.TotalFrames);
var currentF = movie.CurrentFrame();
globalCurrent += Math.abs(currentF - lastCurrent);
lastCurrent = currentF;
var totalF = 0;
if (navigator.appName.indexOf("Microsoft Internet")==-1){
totalF = movie.TotalFrames();
}else{
totalF = movie.TotalFrames;
}
if(totalF < globalCurrent){
gotoDetaultPage();
if(movie.stopplay != 'undefined' && movie.stopplay != null)
movie.stopplay();
}
}
</script>
</head>
<body style="margin: 0;">
<span οnmοusedοwn="gotoDetaultPage()" style="cursor: hand;" title="click to skip this movie / 点击跳过动画">
<object id="flash1" data="flash.swf" type="application/x-shockwave-flash" width="100%" height="100%">
<param name="movie" value="flash.swf" />
<param name="wmode" value="transparent"/>
</object>
</span>
</body>
</html>