ITeye博客

loadModuleReady使用中发现的问题

176170847 · 2010-10-26 14:06 · Flex · Web前端 · Socket · Markdown

private function loadModuleReady(e:ModuleEvent):void
		{
			var iModule:IModuleParam=e.module.factory.create() as IModuleParam;
			*.main.moduleContainer.removeAllChildren();
			//此处只可以使用一次e.module.factory.create,没使用一次其实就是实例化一次
//			*.main.moduleContainer.addChild(e.module.factory.create() as DisplayObject);
			(this.parentApplication as p8).main.moduleContainer.addChild(iModule as DisplayObject);

			if (iModule)
			{
				iModule.setSocket(this._modelLocator.socket);
				iModule.setRemoteObj(ServiceLocator.getInstance().getRemoteObject("Remoting_Services"));
				iModule.setType(0);
			}
		}

 

 

 

在上面的响应方法中:

e.module.factory.create只可使用一次,

每使用一次就是对module的一次初始化。

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。