先定义进度条显示层: 复制代码 代码如下: 下载进度: 定义广告层: 复制代码 代码如下: 定义FLASH显示层: js代码: 复制代码 代码如下: <BR>if(window.navigator.userAgent.indexOf("Firefox")>=1)//判断是否为FIREFOX浏览器,FIREFOX不支持PercentLoaded()函数 <BR>{ <BR>document.getElementById("loadpercent").innerHTML= "Firefox!No Attentions"; <BR>document.getElementById("showSWF").style.display='block'; <BR>} <BR>else <BR>{ <BR>refreshProgress(); <BR>} <br><br>function show()//隐藏AD层、显示FLASH层 <BR>{ <BR>document.getElementById("showAD").style.display='none'; <BR>document.getElementById("showSWF").style.display='block'; <BR>} <br><br>function refreshProgress()//刷新进度条函数 <BR>{ <BR>var downProgressWidth=502; <BR>var bar = document.getElementById("loadpercent"); <BR>var movie = document.getElementById("flashgame"); <BR>var nPercentLoaded = Math.abs(movie.PercentLoaded()); <BR>bar.style.width=Math.ceil(downProgressWidth*nPercentLoaded/100) +"px"; <BR>bar.innerHTML= nPercentLoaded +"%"; <br><br>if(nPercentLoaded==100) <BR>{ <BR>bar.style.width=(downProgressWidth-2) + "px"; bar.innerHTML= "Game download is complete"; show(); <BR>} <BR>else <BR>{ <BR>setTimeout('refreshProgress()',0); <BR>} <BR>}<BR> 其实最好的代码,就是看一些flash游戏网站,是怎样控制,看下源代码就可以了解更多的知识与技巧。