|
1.js轮流播放2个或多个flash(简单的代码,其实可以写成循环):
引用
<script language="javascript">
var i=1;
var flashHTML=new Array();
flashhtml[1]="<object type='application/x-shockwave-flash' data='1.swf' width='650' height='80'><param name='wmode' value='transparent'><param name='movie' value='1.swf'></object>";
flashhtml[2]="<object type='application/x-shockwave-flash' data='2.swf' width='650' height='80'><param name='wmode' value='transparent'><param name='movie' value='2.swf'></object>";
flashhtml[3]="<object type='application/x-shockwave-flash' data='3.swf' width='650' height='80'><param name='wmode' value='transparent'><param name='movie' value='3.swf'></object>";
function showflash(){
if(i==1){
document.getElementById('flash').innerHTML=flashhtml[1];
theTimer=setTimeout("showflash()",15000);
i=2;
}
else if(i==2){
document.getElementById('flash').innerHTML=flashhtml[2];
theTimer=setTimeout("showflash()",8000);
i=3;
}
else{
document.getElementById('flash').innerHTML=flashhtml[3];
theTimer=setTimeout("showflash()",8000);
i=1;
}
}
window.onload=function ()
{showflash();}
</script>
<div id=flash></div>
2.一个仿韩flash导航的制作:
(1).下拉导航,先做出主按钮,再做下拉按钮,新建一个影片剪辑,放置按钮,前1-15祯依次渐入,后15-30祯依次渐出,停止祯加上链接...
(2).新建一个影片剪辑,先放入主按钮,再建一层把下拉按钮的影片剪辑拉入,并且定义实例名:xiala,对按钮写动作:
on (rollOver) {
tellTarget ("../xiala") {
gotoAndPlay(2);
}
gotoAndStop(2);
}
(3).拉到主场景,生成.
演示效果:
http://www.recycle-china.com.cn/huishou/images/daohang.swf |
|