我用Xcelsius创建了一个swf文件。如何检查何时满载?
我试过jquery
$(document).ready(function() {
alert("document ready occurred!");
});
$(window).load(function() {
alert("window load occurred!");
});
但是我在swf准备好之前得到警报
任何javascript替代方案?
感谢您的帮助!
答案 0 :(得分:0)
它似乎无法确定它何时满载。但是如果你想在加载之后做一些事情,你可以在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
}