Swapping depths

I want to be able to swap depths with some movie clips on my site so that they work like windows. Unfortunatly the only method I know of to swap the depths of the windows is to change change the clicked window to the top depth. My problem is I’m loading in the swf files to get the MCs into the current movie and that assigns them the depth, so my way isn’t working. The site I’ve been working on is http://users.apex2000.net/rbrown/asp/flash_db.

If someone can help with this it’d be cool … thanks.

Check out this tutorial made by kirupa himself:

http://www.kirupa.com/developer/actionscript/swapdepth.asp

And questions, holla back!

Thanks, that tutorial was much better than the other one that I had gone over. It explained everything great. I’m still having a few problems though with the way the windows are working. I want the link that is clicked on to display the top window, but for some reason it’s closing out the previous window. Here is the code I have on this:

_level0:highest = “2”;
profile.onPress = function() {
_root.createEmptyMovieClip(“container0”, 1);
loadMovie(“profile.swf”, “container0”);
container0._x = 110;
container0._y = 20;
x = 0;
x = x+2;
_root.container0.swapDepths(x);
};
but.onPress = function() {
_root.createEmptyMovieClip(“container”, 2);
loadMovie(“blog.swf”, “container”);
container._x = 150;
container._y = 20;
x = 0;
x = x+2;
_root.container.swapDepths(x);
};