正文

同步加载多个外部swf的方法2006-07-30 22:44:00

【评论】 【打印】 【字体: 】 本文链接:http://blog.pfan.cn/vfdff/17023.html

分享到:

2006,且行且惜-Fdream's Blog上有更多精彩

连接:  http://www.afdream.com/blog/blogview.asp?logID=12

下面是加载多个 swf 的代码:

function manyLoadMovie(num, x, y, xscal, yscal, dis) {
for (var i = 0; i<num; i++) {
var Temp = createEmptyMovieClip("temp"+i, i);
var L = createEmptyMovieClip("load"+i, i+num);
Temp.t = i;
L.loadMovie(i+".swf");
L._xscale = xscal;
L._yscale = yscal;
L._x = x+i*dis;
L._y = y;
T = createTextField("txt"+i, i+10000, L._x, L._y, 100, 100);
Temp.onEnterFrame = function() {
var a = this._parent["load"+this.t].getBytesLoaded();
var b = this._parent["load"+this.t].getBytesTotal();
this._parent["txt"+this.t].text = int(a*100/b)+"%";
if (a>=b and a>10) {
this._parent["txt"+this.t].removeTextField();
this.removeMovieClip();
}
};
}
}
manyLoadMovie(4, 100, 100, 50, 50, 50);


//参数分别是文件数量,起点x,起点y,宽度比例,高度比例,排列间距.


//注意外部文件分别为0.swf,1.swf,2.swf.........递增的,其实稍微改下,加载图片也一样 

 

http://www.afdream.com/blog/blogview.asp?logID=358这里有个例子 把FLASH 和程序结合起来


阅读(577) | 评论(0)


版权声明:编程爱好者网站为此博客服务提供商,如本文牵涉到版权问题,编程爱好者网站不承担相关责任,如有版权问题请直接与本文作者联系解决。谢谢!

评论

暂无评论
您需要登录后才能评论,请 登录 或者 注册