[英]place a custom component over a PopUp window (called by PopUpManager) in Flex 4
如何在由PopUpManager創建的彈出窗口上顯示自定義組件(在應用程序級別聲明)?
在Application 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本身,以便它可以位於頂部?
你能給我個提示嗎? 謝謝!
嘗試這個,
private var myCustomComp:CustomComp = new CustomComp();
showCustomComp(event:MyEvent):void
{
mx.managers.PopUpManager.addPopUp(myCustomComp ,this,true);
mx.managers.PopUpManager.centerPopUp(myCustomComp );
}
這應該會給UA彈出窗口。 告訴我,如果您仍然遇到任何問題
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.