今天写自己的loader管理类时,发现一个问题,如果证明flash是并发加载资源的呢?
var loader:Loader=new Loader;
loader.contentLoaderInfo.addEventListener(Event.COMPLETE, onChildComp3, false, 0, true);
loader.contentLoaderInfo.addEventListener(Event.OPEN, onChildOpen3, false, 0, true);
loader.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, onChildPro3, false, 0, true);
loader.contentLoaderInfo.addEventListener(HTTPStatusEvent.HTTP_STATUS, onChildHttp3, false, 0, true);
var loader2:Loader=new Loader;
loader2.contentLoaderInfo.addEventListener(Event.COMPLETE, onChildComp3, false, 0, true);
loader2.contentLoaderInfo.addEventListener(Event.OPEN, onChildOpen3, false, 0, true);
loader2.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, onChildPro3, false, 0, true);
loader2.contentLoaderInfo.addEventListener(HTTPStatusEvent.HTTP_STATUS, onChildHttp3, false, 0, true);
var loader3:Loader=new Loader;
loader3.contentLoaderInfo.addEventListener(Event.COMPLETE, onChildComp3, false, 0, true);
loader3.contentLoaderInfo.addEventListener(Event.OPEN, onChildOpen3, false, 0, true);
loader3.contentLoaderInfo.addEventListener(ProgressEvent.PROGRESS, onChildPro3, false, 0, true);
loader3.contentLoaderInfo.addEventListener(HTTPStatusEvent.HTTP_STATUS, onChildHttp3, false, 0, true);
loader.load(new URLRequest("assets/comp.swf"));
loader2.load(new URLRequest("assets/nav.swf"));
loader3.load(new URLRequest("assets/vector.swf"));
如上一段代码,运行时,总是会先输出loader的所有信息,在loader完成后再加载loader2,在loader2完成后再加载loader3~似乎并没有并发加载~
我理解的并发加载是各自loader的progress信息会交错输出。不知道这样理解对不对~
现在还没解决这个问题~郁闷~