Hi, can anybody say me, how make, that my TitleWindow should have height and width depends on childs in this window? This must be somthing, like "autoSize"? Thanks in advanced!
Good day! I have problem with mediator objects removing. My program is cuted into modules. In beginning, when i press button for window opening, some my Commans is running from Facade. In this Command will create Mediator and Proxy:
:
...... override public function execute(note:INotification):void { sysParamProxy = facade.retrieveProxy(SysParamProxy.NAME) as SysParamProxy;
if (sysParamProxy == null){ sysParamProxy = new SysParamProxy(); facade.registerProxy(sysParamProxy); } module = note.getBody() as SysParamModule; sysParamMediator = facade.retrieveMediator(SysParamMediator.NAME) as SysParamMediator; if (sysParamMediator == null){ sysParamMediator = new SysParamMediator(module.sysParamCreatePanel); facade.registerMediator(sysParamMediator); } sysParamProxy.getSysParams(); } ..... Then when i window is open, i press some button that dispatch some event SAVE_SYS_PARAM Mediator retrieve this event and run some function, that run function in proxy.
:
private function onSave(event:Event):void { sysParamProxy.saveSysParams(event.target.sys_param as ArrayCollection); } When proxy continue with function, it send notification ApplicationFacade.SYS_PARAM_SAVED and Mediator than execte some code
:
public override function handleNotification(note:INotification):void { var data:Array; switch (note.getName()){ case ApplicationFacade.SYS_PARAM_RECEIVED: { data = (note.getBody() as ArrayCollection).source; sysParamPanel.sys_param = new ArrayCollection(data); break; } case ApplicationFacade.SYS_PARAM_SAVED: // This code will be executed { trace("alert"); Alert.show("Settings saved"); } default: break; } } And now my question: When i first open window and press button i become one message "Alert", than i close window and open it one more and press button. This time i become two messages Alert, when i close window one more, i become 3 messages "Alert"... It seems like my Mediators are not deleted from my Facade. I have traced and know, that with proxies is all right. How can i right delete my Mediators?