将自定义组件放置在 Flex 4 中的 PopUp 窗口上(由 PopUpManager 调用)

发布于 2024-12-21 09:15:54 字数 764 浏览 0 评论 0原文

如何在 PopUpManager 创建的 Popup 上显示自定义组件(在应用程序级别声明)?

在应用程序 mxml 中,我有以下代码片段:

private var myCustomComp:CustomComp = new CustomComp;

/** Called on by an event listener **/
protected function showCustomComp(event:MyEvent):void 
{
  myCustomComp.visible = true; 
  // place PopUpManager windows 
  this.setElementIndex(virtualKeyboard,this.numElements-1); // Also tried with 0 instead of numElements-1, but nothing! 
}

弹出窗口的调用方式如下:

PopUpManager.addPopUp(myPopup,FlexGlobals.topLevelApplication as DisplayObject,true, PopUpManagerChildList.APPLICATION);

无论如何,myCustomComp 不会显示在 PopUpManager 调用的任何窗口上。是否有任何快捷方式或者我应该使 myCustomComp 成为从 PopUpManager 调用的 PopUp 本身,以便它可以位于顶部?

你能给我一个提示吗?谢谢!

How can I display a custom component (declared at the Application level) over a Popup created by the PopUpManager?

At the Application mxml, I've the following pieces of code:

private var myCustomComp:CustomComp = new CustomComp;

/** Called on by an event listener **/
protected function showCustomComp(event:MyEvent):void 
{
  myCustomComp.visible = true; 
  // place PopUpManager windows 
  this.setElementIndex(virtualKeyboard,this.numElements-1); // Also tried with 0 instead of numElements-1, but nothing! 
}

The Popup window is called like this:

PopUpManager.addPopUp(myPopup,FlexGlobals.topLevelApplication as DisplayObject,true, PopUpManagerChildList.APPLICATION);

Anyway, myCustomComp is not showing over any window called by the PopUpManager. Is there any shortcut or should I make myCustomComp a PopUp itself called from the PopUpManager so it could be on top?

Could you give me a hint? Thanks!

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

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

发布评论

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

评论(1

奶茶白久 2024-12-28 09:15:54

试试这个,

private var myCustomComp:CustomComp = new CustomComp();

showCustomComp(event:MyEvent):void 
{
 mx.managers.PopUpManager.addPopUp(myCustomComp ,this,true);
 mx.managers.PopUpManager.centerPopUp(myCustomComp );
}

这应该会弹出 ua。告诉我,如果您仍然遇到任何问题

Try this,

private var myCustomComp:CustomComp = new CustomComp();

showCustomComp(event:MyEvent):void 
{
 mx.managers.PopUpManager.addPopUp(myCustomComp ,this,true);
 mx.managers.PopUpManager.centerPopUp(myCustomComp );
}

This should give u a popup. Tell me, if u are still facing any problem

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