var context:LoaderContext = new LoaderContext( ); context.applicationDomain = new ApplicationDomain(ApplicationDomain.currentDomain);//载入作为子domain context.applicationDomain = new ApplicationDomain();//载入作为全新domain context.applicationDomain = ApplicationDomain.currentDomain;//载入当前domain var request:URLRequest = new URLRequest("RuntimeLoadingExample.swf"); var loader:Loader = new Loader( ); loader.load(request, context);
5、关于preloader Preloader是一个轻量级的类,在systemManager的第一帧被实例化,preloader会dispatch出一系列的事件,由progress bar监听实现loading界面,一旦应用进入第二帧待application初始化后会借由system manager通知preloader初始化进度,preloader通知system manager其准备待删除 Preloader的事件dispatch: progress Indicates download progress complete Indicates that the download is complete rslError Indicates that a runtime shared library could not load rslProgress Indicates the download progress for a runtime shared library rslComplete Indicates that the download is complete for runtime shared libraries initProgress Indicates that the application is initializing initComplete Indicates that the application has initialized