2014-01-21 52 views
0

我用Xcelsius創建了一個swf文件。我怎樣才能檢查它何時滿載?如何檢查嵌入在html上的Xcelsius swf是否已完全加載?

我試圖jQuery的

$(document).ready(function() { 
     alert("document ready occurred!"); 
}); 

$(window).load(function() { 
     alert("window load occurred!"); 
}); 

,但我得到的警報之前的SWF準備

任何JavaScript方法嗎?

感謝您的幫助!

回答

0

它似乎你不能實際檢查其完全加載。但是,如果你想要做的事之後it's加載,你可以在JavaScript中使用的函數與setInternval,只是通過屬性直到電影得到它

function setAttribute(){ 
     var attributes = { 
     id: "movie", 
     name: "movie" 
     }; 
     swfobject.embedSWF("movie.swf", "movie", "1025", "678", "9.0.0", attributes); 
     var i = 1; 
      var sInt = setInterval(function() { 
      if(i >= 10) { 
       clearInterval(sInt); 
      }else{ 
       i++; 
      } 
      //here goes the parameter you want to pass to the movie 
     }, 500); //increase the interval if you need it 
    } 
相關問題