2 Replies Latest reply on Sep 4, 2006 2:55 AM by The_BIG_screen.cjb.net

    Closing the window component from within the window

    The_BIG_screen.cjb.net
      Hello,

      I used the following code to open the flash window component.

      myWindow = mx.managers.PopUpManager.createPopUp(_root, mx.containers.Window, true, {title:evt.target.selectedItem.name, contentPath:"ProductForm", closeButton:true});
      // set the dimensions of the popup window.
      myWindow.setSize(340, 210);
      // define a listener which closes the popup window when the close button in the upper right-hand corner is clicked.
      var closeListener:Object = new Object();
      closeListener.click = function(evt) {
      evt.target.deletePopUp();
      };
      myWindow.addEventListener("click", closeListener);

      What code will i need to close the window from a button loaded within the window.

      A bit to confusing for me.

      Cheers for the help