Hi I have couple of modules in my application and each module will different popups. So i have to change the code in all the modules for storing the instance and passing to main application which i do not want to do.
And as all my popus are modal so systemManager.popUpChildren.numChildren should solve my problem. Thanks ilikeflex --- In [email protected], "Tracy Spratt" <tspr...@...> wrote: > > Why not store a reference to the popup in an instance variable instead > of what you are trying? > > > > Tracy Spratt > Lariat Services > > Flex development bandwidth available > > ________________________________ > > From: [email protected] [mailto:[email protected]] On > Behalf Of ilikeflex > Sent: Monday, February 02, 2009 2:25 PM > To: [email protected] > Subject: [flexcoders] resize the popup window according to browser > > > > Hi > > I am trying to > > 1.resize the popup window > 2.center the pop up > > when the browser is resized. I am trying to get the ref of the pop up > window through systemManager.popUpChildren.numChildren. But this does > not return the correct numbers.It display two though there is only > one popup. > > Copy paste the code and resize the browser to see the result. > > <?xml version="1.0" encoding="utf-8"?> > <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml > <http://www.adobe.com/2006/mxml> " > layout="vertical" creationComplete="onComplete()" > > > <mx:Script> > <![CDATA[ > import mx.events.ResizeEvent; > import mx.controls.Alert; > import mx.containers.TitleWindow; > import mx.containers.Tile; > import mx.managers.PopUpManager; > import mx.managers.PopUpManagerChildList; > private function onComplete() : void { > addEventListener > (ResizeEvent.RESIZE,onCountPopups); > } > > private function onNewPopup() : void > { > PopUpManager.createPopUp(this, > TitleWindow,true, PopUpManagerChildList.POPUP) > } > > private function onCountPopups(event:Event) : > void > { > var nChildren : int = > systemManager.popUpChildren.numChildren; > trace("number of popups: " + > nChildren); > } > ]]> > </mx:Script> > > <mx:Button label="new Popup" click="onNewPopup()"/> > <mx:Button label="count popups" click="onCountPopups(event)"/> > </mx:Application> > > How to get the correct number??? > > Any pointer?? > > Thanks > ilikeflex >

