# Swapping depths with a fade

**URL:** <https://forum.kirupa.com/t/swapping-depths-with-a-fade/133252>\
**Category:** Uncategorized\
**Created:** [January 6, 2005, 11:55pm UTC](https://forum.kirupa.com/t/swapping-depths-with-a-fade/133252 "2005-01-06T23:55:13Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mprzybylski](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/mprzybylski/32/613_2.png) [@mprzybylski](https://forum.kirupa.com/u/mprzybylski)\
**Post date:** [January 6, 2005, 11:55pm UTC](https://forum.kirupa.com/t/swapping-depths-with-a-fade/133252/1 "2005-01-06T23:55:13Z")

</div>

Hello,  
I want to swap depths on movieclips overlaying each other but instead of the new clip on rollover just popping up over the other one, i want it to fade into the top.

here is an attached .fla file in mx2004 format.

for those not using 2004, here is the code:

```php
but1.onRollOver = but2.onRollOver = but3.onRollOver = but4.onRollOver = function() {
 	this.swapDepths(getNextHighestDepth());
 };

```

Also, is there a way to streamline this code so i dont have to type the button instance names every time i add another?
