I’m trying to organise my code better and figured it would be good to place the pop-up logic within the component that’s being popped-up. However, I can’t seem to do this without causing one error or another. I also need to make the pop-up modal.
I’m doing something along these lines (psuedo code):
<mx:TitleWindow >
<mx:Label id="messageLabel" />
<mx:Script>
<![CDATA[
public function show():void{
PopUpManager.addPopUp(this, Application.application as DisplayObject, true);
PopUpManager.centerPopUp(this);
}
public function hide():void{
PopUpManager.removePopUp(this);
}
]]>
</mx:Script>
</mx:TitleWindow>
Can anyone help?
It appears that this works, after all.
I’m not sure what I was doing wrong, but after Ryan’s response I rewrote the code, using the above pseudo code as a starting point. Now it seems to work.