方法一:
var moduleLoader : ModuleLoader = new ModuleLoader();
moduleLoader.applicationDomain = ApplicationDomain.currentDomain;
addElement( moduleLoader );
moduleLoader.loadModule( "MyModule.swf" );
方法二:
var moduleLoader2 : ModuleLoader = new ModuleLoader();
moduleLoader2.applicationDomain = ApplicationDomain.currentDomain;
moduleLoader2.addEventListener( ModuleEvent.READY , moduleLoader_readyHandler );
moduleLoader2.loadModule( "MyModule.swf" );
protected function moduleLoader_readyHandler( event : ModuleEvent ) : void
{
addElement( IVisualElement( ModuleLoader( event.currentTarget ) ) );
}