0
votes

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!

1

1 Answers

1
votes

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