尝试在应用程序中居中时 Pop 出现错误

发布于 2024-12-06 01:56:46 字数 640 浏览 1 评论 0原文

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?
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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

浅笑轻吟梦一曲 2024-12-13 01:56:46

如果您想稍后将 panel/titleWindow 居中,您应该将 FlexGlobals.topLevelApplication 作为参数传递给 createpopup。

所以,

var helpWindow:TitleWindow=
                    PopUpManager.createPopUp(this,FlexGlobals.topLevelApplication , true) as TitleWindow;
                    PopUpManager.centerPopUp(helpWindow);

我确信这会起作用。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文