Learning ActionScript 2.0 in Adobe Flash |
|
|
|
| Working with Movie Clips > Managing movie clip depths > Swapping movie clip depths | |||
To swap the depths of two movie clips on the same timeline, use MovieClip.swapDepths(). The following examples show how two movie clip instances can swap depths at runtime.
To swap movie clip depths:
first_mc.onRelease = function() {
this.swapDepths(second_mc);
};
second_mc.onRelease = function() {
this.swapDepths(first_mc);
};
When you click the instances on the Stage, they swap depths. You'll see the two instances change which clip is on top of the other clip.
For more information, see swapDepths (MovieClip.swapDepths method) in the ActionScript 2.0 Language Reference.
|
|
|
|