10 Replies Latest reply on Oct 2, 2007 3:56 PM by dimival

    How does one trap the event of a programatic close of a popup?

    aceinc
      I have a popup, and I instantiate an event listener to trap the close like so;

      entryWindowInstance.addEventListener("close", doSomething);

      This works swimmingly when the user clicks the x in the upper right corner, but does not work when I close the popup progammatically. The code I use to close the window is;

      closeWindow();


      Further snippets of code;

      <mx:TitleWindow x="10" y="10" width="653" height="455" xmlns:mx=" http://www.adobe.com/2006/mxml"
      xmlns:fc="com.adobe.flex.extras.controls.*"
      layout="absolute" title="Log Entry"
      creationComplete="initApp();"
      showCloseButton="true"
      close="closeWindow()">

      private function closeWindow():void
      {
      PopUpManager.removePopUp(this);
      }//closeWindow

      Any ideas on what event I should trap in the calling module to make sure that when the popup closes I execute something in my calling module.

      I am using the event trapping method because I could not find a way to reference the routine from the popup. I am in a popup that is called by a module, that is called by another module that is called by the application.

      As always all help is appreciated.

      Paul