# swapDepth

**URL:** <https://forum.kirupa.com/t/swapdepth/247783>\
**Category:** flash\
**Created:** [December 29, 2007, 5:34pm UTC](https://forum.kirupa.com/t/swapdepth/247783 "2007-12-29T17:34:27Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![fivepoints](https://avatars.discourse-cdn.com/v4/letter/f/59ef9b/32.png) [@fivepoints](https://forum.kirupa.com/u/fivepoints)\
**Post date:** [December 29, 2007, 5:34pm UTC](https://forum.kirupa.com/t/swapdepth/247783/1 "2007-12-29T17:34:27Z")

</div>

I have three movie clips onstage, and I am trying to swap the depths. These clips are located in a movie called “Home” which I am trying to load into an empty movieclip called MyMclip on the main timeline. The code for the movieclips:

on (press, release, dragOver, dragOut) {  
\_root.x +=2;  
\_root.myMovie3.swapDepths(\_root.x);  
}

This works fine when I view the swf "Home"by itself, but does not work when I load it into the main timeline. I have tried changing \_root to “this”. Can someone tell me what I am doing wrong. myMovie3 is one of the three movieclips I am trying to swap.
