# Popup aggravation - help needed

**URL:** <https://forum.kirupa.com/t/popup-aggravation-help-needed/114703>\
**Category:** Uncategorized\
**Created:** [June 30, 2004, 10:59pm UTC](https://forum.kirupa.com/t/popup-aggravation-help-needed/114703 "2004-06-30T22:59:37Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![icenine](https://avatars.discourse-cdn.com/v4/letter/i/46a35a/32.png) [@icenine](https://forum.kirupa.com/u/icenine)\
**Post date:** [June 30, 2004, 10:59pm UTC](https://forum.kirupa.com/t/popup-aggravation-help-needed/114703/1 "2004-06-30T22:59:37Z")

</div>

I’m having a problem destroying a pop-up.  
The window creates beautifully, but does not close on click of the ‘x’.

Any and all help appreciated.

Here’s the code

```auto

buttonListener = new Object();
buttonListener.click = function(){
  myWindow = mx.managers.PopUpManager.createPopUp(_root, mx.containers.Window, true, { closeButton: true, title:"Change Password", contentPath:"test_mc"});
  myWindow.setSize(275,110);
}
advanced_btn.addEventListener("click", buttonListener);
closeWin = new Object();
closeWin.click = function(){
   myWindow.deletePopUp();
}
myWindow.addEventListener("click", closeWin);
 

```
