-
Window Component Problem
Hi,
Ok my code is below and Im having trouble being able to use the close button on the window component.
on (press) {
import mx.managers.PopUpManager;
import mx.containers.Window;
var myTW = PopUpManager.createPopUp(_root.airPane_mc, Window, true, {closeButton:true, title:"My Window",contentPath:"external/land_droid.swf"});
myTW.setSize(800, 600);
myTW.title = "Droid"
windowListener = new Object();
windowListener.click = function(evt) {
_root.myTW.deletePopUp();
};
myTW.addEventListener("click", windowListener);
}
It worked fine when this action was on a button instance in the stage but now this code is inside a movie clip with a button inside of it..it loads the window fine and plays the movie fine but closing it does not work..any help would very helpful.
Thanks
-
You are probably not creating the instance on stage. Eliminate _root from _root.myTW.deletePopUp(); and see what you get.
-
I added my the full path for the movie clip
_root.airPane_mc.myTW.deletePopUp(); and it seems to work fine now.
Thanks again for the reply.