Over 10 years of community discussion and knowledge are maintained here as a read-only archive.
public static var moduleCount:Number = 0;public var facade:MyModuleFacade = MyModuleFacade.getInstance( MyModuleFacade.NAME+"/"+moduleCount++ );
public static function getInstance( key:String ) : ApplicationFacade { trace("getInstance " + key ); if ( instanceMap[ key ] == null ) instanceMap[ key ] = new ApplicationFacade( key ); return instanceMap[ key ] as ApplicationFacade; }
return ApplicationFacade( instanceMap[ key ] );
var myModule:IMyModuleInterface = loader.content as IMyModuleInterface;var myNewInstance = myModule.getInstance();
public class MyModule extends DisplayObject implements IModuleInterface...public function getInstance( name:String ):IModuleInterface{ var m:IModuleInterface = new MyModule(); m.setName( name ); return new MyModule();}
function getInstance():IModuleInterfacefunction setName():void