正在加载...

自己写的。高手指点,新人学习。

再申明一下注释为什么用英文。毕竟编程 还是英文 更加合适。用中文写类名、函数名也许也能成功,但是跟那些英文放到一起总不太合适,这并不是盲目崇洋媚外。

备,多个MC的装载 用 switch … case 以 target_mc来分别判断。

var picPicker:MovieClipLoader = new MovieClipLoader();
//create a new MCLoader
var awListener:Object = new Object();
//set a Listener
var url:String = "images/CuteCats.jpg";
//var url:String = "images/aaaaCuteCats.jpg"; give a wrong URL to triggle the "onLoadError"
_root.createEmptyMovieClip("picInstance", 1);
//create a receiver(like a volume to receive the pic/swf files outside
awListener.onLoadComplete = function(getTarget) {
  //just get the instance name of our MC. getTarget is no more than a bridge^_^
  trace("loadComplete");
};
awListener.onLoadError = function(getTarget, errorCode) {
  trace("Error Occured");
  trace(errorCode);
  //just get the instance name of our MC. getTarget is no more than a bridge^_^
};
awListener.onLoadStart = function(getTarget) {
  trace("Receiving data…");
};
awListener.onLoadProgress = function(getTarget, loadedBytes, totalBytes) {
  //—such Content is not available in Flash but you can see in LocalAreaNetwork or Internet
  _root.awtext.text = loadedBytes;
  trace(loadedBytes);
  trace(totalBytes);
  trace(loadedBytes/totalBytes);
  //—such Content is not available in Flash but you can see in LocalAreaNetwork or Internet
};
awListener.onLoadInit = function(getTarget) {
  trace(getTarget+" is ready");
  // the Target is ready
};
picPicker.addListener(awListener);
picPicker.loadClip(url, picInstance);

还没找到您要的东西?Google试试看吧,
Google更注重原创、时效性好的文章:


本文相关评论: 一条都没有呢
[支持Ctrl+Enter]为了我们大家和家人的安全,留言请慎重!
声明:
1、本站仅与见过面的个人博客交换链接,见此文
2、留言时的头像是Gravatar提供的服务。如果您有兴趣并且有闲暇时间,可以看看这里的介绍