to access the application (ie top level) use (eg for width) Application.application.width (for flex 3) or FlexGlobals.topLevelApplication.width (for flex 4)
ps: you can use PopupManager.centerPopup(myPopup) to center it
But still its not working..
Neither the Poup came into Center nor the Application properties are accesed..
Please help me..
1 person found this helpful
try changing this line:
PopUpManager.addPopUp(myPopup,this,true); //adds popup to current object
PopUpManager.addPopUp(myPopup, root, true); //adds popup to top level object
it should fix the popup not centering properly - it is centering itself, but with respect to the current visual object (where your open popup code is). changing to root will add the popup to the top level and so centering it there will center it with respect to the application itself.
also, add this line below the one above:
and see what it traces out (in debug mode) - is it giving the correct value?