# Swap Depths

**URL:** https://forum.kirupa.com/t/swap-depths/121007
**Category:** Uncategorized
**Created:** [August 30, 2004, 12:30am UTC](https://forum.kirupa.com/t/swap-depths/121007 "2004-08-30T00:30:04Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![Skinny\_T](https://avatars.discourse-cdn.com/v4/letter/s/eada6e/32.png) [@Skinny\_T](https://forum.kirupa.com/u/Skinny_T)
#### Post date: [August 30, 2004, 12:30am UTC](https://forum.kirupa.com/t/swap-depths/121007/1 "2004-08-30T00:30:04Z")

</div>

I’m using this code:  
on(press){  
\_root.myDepth++;  
\_parent.swapDepths(\_root.myDepth);  
}  
and it works fine but it keeps sends it above the other higher layers on my scene, How can I prevent this?
