Swapdepths on a ui window component

hi everyone

i have been trying to work this out for some time and i can’t find any info about this on the web.

I hope someone can help cause i’m pulling my hair out.

The problem i have is that i want to use the ui window component (in order to keep file size down, and it just works well) but i want to use multiple windows on the stage. It was simple to get them to open with PopUpManager.createPopUp and to intialise the close button with deletePopUp(). Now heres the big but i can’t get a swapdepths function to work.

I have added in an event listener for the close button and the swapdepths but only one fuction will work at a time, ie i can get the swap depth to work but you can’t drag the windows or close them, or you can drag and close one window but the other will not do anything until the top one is closed.

i know that it’s a swapdepth problem but i can’t work out where to put the swapdepth in the code to make all fuctions work at once.

The code is below

var myq1:MovieClip = PopUpManager.createPopUp(_root, Window, true, {closeButton:true, title:“Question 1”, contentPath:‘q1’});
myq1.setSize(600,450);
var q1Listener:Object = new Object();
q1Listener.click = function(evt:Object){
evt.target.deletePopUp();
}
myq1.addEventListener(“click”, q1Listener);

var myq1a:MovieClip = PopUpManager.createPopUp(_root, Window, true, {closeButton:true, title:“Planning group work - Answer 1”, contentPath:‘q1a’});
myq1a.setSize(519,380);
var q1aListener:Object = new Object();
q1aListener.click = function(evt:Object){
evt.target.deletePopUp();
}
myq1a.addEventListener(“click”, q1aListener);


and here is the swapdepth code


myq1a.onRelease = function() {
this.swapDepths(myq1);
};
myq1.onRelease = function() {
this.swapDepths(myq1a);
};

now i probably am just being really stupid here and it’s my first post on the forum, but reading posts here has always helped me out in the past so i hope someone can now

Thanks

Tizz