I’m creating a new window with the window component and it opens fine but I can’t get it to close. I’m not sure if I’m not opening it right or the code to close it is wrong… or maybe a bug?
Can someone please take a look at the code and let me know what I’m doing wrong here.
// open new window for charts
openWinListener = new Object();
openWinListener.change = function(eventObject) {
newWindow = mx.managers.PopUpManager.createPopUp(_root, mx.containers.Window, false, {title:tfStats_list.selectedItem.label, contentPath:statsUrlHolder_label.text, closeButton:true});
newWindow.setSize(300,200);
pBar.source = newWindow;
};
_root.tfStats_list.addEventListener(“change”, openWinListener);
//
//close charts window
closeWinListener = new Object();
closeWinListener.click = function() {
_root.newWindow.deletePopUp();
}
newWindow.addEventListener(“click”, closeWinListener);