# PopupManager not firing "complete" event

**URL:** <https://forum.kirupa.com/t/popupmanager-not-firing-complete-event/228245>\
**Category:** flash\
**Created:** [June 6, 2007, 1:14pm UTC](https://forum.kirupa.com/t/popupmanager-not-firing-complete-event/228245 "2007-06-06T13:14:46Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![rsantos01](https://avatars.discourse-cdn.com/v4/letter/r/ed8c4c/32.png) [@rsantos01](https://forum.kirupa.com/u/rsantos01)\
**Post date:** [June 6, 2007, 1:14pm UTC](https://forum.kirupa.com/t/popupmanager-not-firing-complete-event/228245/1 "2007-06-06T13:14:46Z")

</div>

![](http://forum.kirupa.com/uploads/kirupa/3748/6b0bf5e30b0beb24.gif) **PopupManager not firing “complete” event**  
The following code works in “test movie” mode.

But when I publish and view online it works about half the time. ![](http://forum.kirupa.com/uploads/kirupa/1799/6a24f1d926eff459.gif)

My cancel button does not have a listener associated and the delete button is visible.

Does anyone see a problem with what I am doing?

var myWindow = mx.managers.PopUpManager.createPopUp(\_root, mx.containers.Window, true);

var myWindowListener:Object = new Object();

myWindowListener.complete = function()  
{  
modalWindow = myWindow.content;  
modalWindow.btnCancel.addEventListener(“click”, myWindowListener);  
modalWindow.btn\_Delete.visible=false;  
}

myWindow.addEventListener(“complete”, myWindowListener);
