trashman
03-22-2005, 08:22 AM
hey all-
i've been working with the popUpManager class to popup a window component. i can open a window with a frame action, and its close button will close the window. but if i use a button with an eventListener or put the popUp code on a button, i can't get it to close anymore. could anyone tell me why the following code would keep the window's close button from working??
buttonListener = new Object();
buttonListener.click = function(){
myWindow = mx.managers.PopUpManager.createPopUp(_root, mx.containers.Window, true, {closeButton:true, title:"cool popUp", contentPath: "image01.jpg"});
myWindow.setSize(240,132);
}
close = new Object();
close.click = function(){
myWindow.deletePopUp();
}
button.addEventListener("click", buttonListener);
myWindow.addEventListener("click", close);
all i have is this code on frame 1 of an 'actions' layer, a button component called "button" (also on frame 1) and a window component in the library.
i'm stumped! any thoughts?
cheers!
-j
i've been working with the popUpManager class to popup a window component. i can open a window with a frame action, and its close button will close the window. but if i use a button with an eventListener or put the popUp code on a button, i can't get it to close anymore. could anyone tell me why the following code would keep the window's close button from working??
buttonListener = new Object();
buttonListener.click = function(){
myWindow = mx.managers.PopUpManager.createPopUp(_root, mx.containers.Window, true, {closeButton:true, title:"cool popUp", contentPath: "image01.jpg"});
myWindow.setSize(240,132);
}
close = new Object();
close.click = function(){
myWindow.deletePopUp();
}
button.addEventListener("click", buttonListener);
myWindow.addEventListener("click", close);
all i have is this code on frame 1 of an 'actions' layer, a button component called "button" (also on frame 1) and a window component in the library.
i'm stumped! any thoughts?
cheers!
-j