展开全部
this.createEmptyMovieClip("preloader", 10000);
this.createEmptyMovieClip("mc", 10001);
//动态创建一 mc,用来装载swf
mc.loadMovie("2.swf");
//加载外部2.swf
mc._visible = false;
//先令mc不可见
//-------------------加载进度条----------------
preloader.onEnterFrame = function() {
var l = mc.getBytesLoaded();
var t = mc.getBytesTotal();
var getPercent = l/t;
loadText = Math.round(getPercent*100)+"%completed";
//一动态文本框的var: loadTest
loadBar._width = getPercent*100;
//进度条的长度,主场景中其 instance name: loadBar
if (l>0 && l>=t) {
mc._visible = 1;
delete this.onEnterFrame;
//加载完毕后令mc可见,并stop loop (delete this.onEnterFrame;)
}
// ----------------------这段代码就是用来判断加载的情况
如果你的到进度条是100帧的动画,这样写:
loadBar._width = getPercent*100;改为:
loadBar.gotoAndPlay(Math.round(getPercent*100));
this.createEmptyMovieClip("mc", 10001);
//动态创建一 mc,用来装载swf
mc.loadMovie("2.swf");
//加载外部2.swf
mc._visible = false;
//先令mc不可见
//-------------------加载进度条----------------
preloader.onEnterFrame = function() {
var l = mc.getBytesLoaded();
var t = mc.getBytesTotal();
var getPercent = l/t;
loadText = Math.round(getPercent*100)+"%completed";
//一动态文本框的var: loadTest
loadBar._width = getPercent*100;
//进度条的长度,主场景中其 instance name: loadBar
if (l>0 && l>=t) {
mc._visible = 1;
delete this.onEnterFrame;
//加载完毕后令mc可见,并stop loop (delete this.onEnterFrame;)
}
// ----------------------这段代码就是用来判断加载的情况
如果你的到进度条是100帧的动画,这样写:
loadBar._width = getPercent*100;改为:
loadBar.gotoAndPlay(Math.round(getPercent*100));
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询