因为网速不同,所以有的时候会加载比较慢,在显示flash前,会长时间空白.
有没办法直接用javascript来写一个方法,在打开falsh前显示loading...
(我flash是用window.open直接打开的)

解决方案 »

  1.   


    <div id="hid" style="margin-top:20%;display:none;margin-left:50%;">loading... </div>
    <script>
    //5秒延迟
    var test=function(){
        document.getElementById("hid").style.display="block";
    };setTimeout(test(),5000);</script>
      

  2.   


    <div id="hid" style="margin-top:20%;display:block;margin-left:50%;">loading... </div>
    <script>
    //5秒延迟
    var test=function(){
        document.getElementById("hid").style.display="none";
    };setTimeout(test,5000);</script>
      

  3.   

    用js写一个加载效果并不难,关键是如何让它侦听到flash加载完成的事件。
    actionscript3.0提供了一个External接口,用于as和网页上其他脚本的交互,你可以先在页面上写一个js函数用于显示flash,我们假设它叫showFlash(),然后在as端编写flash加载完成事件的处理程序:public function afterInit():void{
      External.call("showFlash");
    }当flash加载完成时会调用afterInit()方法,这个方法再调用页面上的js函数showFlash()。