Hello I am having this error when trying to center my popUp. If I remove the centerPopUp code line, the popUp appears but of course is not centered.
The Error is as such:
TypeError: Error #1009: Cannot access a property or method of a null object reference.
at mx.managers::PopUpManagerImpl/centerPopUp()[E:\dev\4.5.1\frameworks\projects\framework\src\mx\managers\PopUpManagerImpl.as:494]
My Code:
var helpWindow:TitleWindow=
开发者_如何转开发 PopUpManager.createPopUp(this, screen_Name, true) as TitleWindow;
PopUpManager.centerPopUp(helpWindow);
Can someone address this issue?
You should be passing the FlexGlobals.topLevelApplication as an argument to createpopup if you want to center your panel/titleWindow later on.
So, here it will be
var helpWindow:TitleWindow=
PopUpManager.createPopUp(this,FlexGlobals.topLevelApplication , true) as TitleWindow;
PopUpManager.centerPopUp(helpWindow);
Im sure this will work.
精彩评论