This content has been marked as final. Show 3 replies
use the swapDepths() method of movieclips.
That is because you aren't expecting the correct thing. Check out getNextHighestDepth() in the help files. You will see it just returns a number that tells you what the next highest depth is. It doesn't put anything there or DO anything. So in this case it is telling you what the next highest depth inside a_mc is (most likely 0) and since you aren't assigning that to a variable it is lost and you are done.
But that isn't the approach you even want. So let us look at something else. What you need is swapDepths() that actually does something.
swapDepths() works two ways, you can give it two clips and it will swap them both. So something like this:
Will switch the depths of the two clips mentioned there. However, both clips must be inside the same parent clip. So the both must be on the _root level or if clip1 is inside myMovies then clip2 must be inside myMovies and so on.
The other way that swapDepths works is by just giving a number:
Will put clip1 on depth 1000. If there is already something on 1000 it will go to where ever clip1 was before it was swapped to 1000. Again, all the clips you have will need to be in the same parent clip.
You should only use positive depths and you have quite a few of them from 1 (they say you can use 0, but I don't) to a bit over 1,000,000 and really even higher, but you have to be careful. To learn everything about depths in Flash see this tutorial.
Thanks... just used swapDepths(1); and it worked just great.
Wish the help files were easier to search.