Hi!
I’ve been following the [URL=“http://www.kirupa.com/developer/actionscript/swapdepth.htm”]Changing Stacking Order (swapDepth) tutorial
but there’s something I’d like to know.
In this tutorial, we have 3 buttons inside 3 Mc’s. Each Mc is called green, yellow and blue.
The AS code for each button is:
on (press, release, dragOver, dragOut) {
x = 0;
x = x+2;
_root.green.swapDepths(x);
}
on (press, release, dragOver, dragOut) {
x = 0;
x = x+2;
_root.yellow.swapDepths(x);
}
on (press, release, dragOver, dragOut) {
x = 0;
x = x+2;
_root.blue.swapDepths(x);
}
What I would like to get is that the MC (window) that I click, goes to the top, BUT respecting the relative position for the others. I mean, in this tutorial, if you run the swf file and put every window a bit one over the other, and click the bottom window, it will come to the top, but the other two won’t keep their relative position because the clicked window will be swapped with the one on the top. Understand? (it’s very simple although difficult to explain).
To make it easier: let’s imagine we have 3 papers on the table and I pick up the one in the bottom and put it on top…this is exactly what I want (but in this tutorial, the other 2 papers are moved aswell). I just want that the window I click gets on top of the other 2, nothing else.
According to Kirupa’s words, this EXAMPLE here is done using swapdepth aswell, and IT’S EXACTLY the behaviour that I want. Just compare this one with the one in the tutorial and see the different window behaviour.
The thing is that I don’t know how to do this with “swapdepths”. In the AS reference bok it says it can be done but (as usual) they don’t tell you how to do it…
Any help please?
Thank you very much.
Manare