var myloader:MovieClipLoader = new MovieClipLoader();
//建一个MovieClipLoader对象
var myListener:Object = new Object();
//建一个Object对象
myloader.addListener(myListener);
//为MovieClipLoader对象myloader增加侦听事件
myListener.onLoadProgress = function(targetMC, loadedBytes, totalBytes) {
//调用MovieClipLoader的onLoadProgress方法,关于这个方法的具体用法可以查帮助
_root.lmc.gotoAndStop(int(loadedBytes/totalBytes*100));
_root.tt.text = loadedBytes/totalBytes*100;
//loadedBytes就是己加载的字节数,
//totalBytes就是总的字节数,
};
myListener.onLoadStart = function(targetMC) {
//调用MovieClipLoader的onLoadStart方法,当加载一开始时.
_root.lmc._visible = true;
//把加载条设为可视
mymcc.stop();
//让加载图片的影片先停止播放.因为图片还没有加载完呢.
};
myListener.onLoadComplete = function(targetMC) {
//调用MovieClipLoader的onLoadComplete 方法,当加载完成时执行以下语句.
mymcc.play();
//让加载图片的影片开始播放
};
myloader.loadClip("ll.jpg", mymcc);
//调用MovieClipLoader对象myloader的loadClip方法来加载图片.把图片加载 到场景中的mymc里去
[ 本帖最后由 steamlin 于 2006-8-28 18:02 编辑 ]
[img]/Files/BeyondPic/2007-1/30/rar.gif[/img]
[url=http://space.flash8.net/bbs/member.php?action=credits&view=getattach]附件[/url]
:
[url=http://space.flash8.net/bbs/attachment.php?aid=307402]MovieClipLoader.rar[/url]
本文转自:http://www.5uflash.com/flashjiaocheng/Flash-loadingjiaocheng/2062.html