# swapDepth and setMask trouble

**URL:** <https://forum.kirupa.com/t/swapdepth-and-setmask-trouble/227531>\
**Category:** flash\
**Created:** [May 31, 2007, 1:28am UTC](https://forum.kirupa.com/t/swapdepth-and-setmask-trouble/227531 "2007-05-31T01:28:53Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![wilky19](https://avatars.discourse-cdn.com/v4/letter/w/a87d85/32.png) [@wilky19](https://forum.kirupa.com/u/wilky19)\
**Post date:** [May 31, 2007, 1:28am UTC](https://forum.kirupa.com/t/swapdepth-and-setmask-trouble/227531/1 "2007-05-31T01:28:53Z")

</div>

hi im having some trouble when trying to implement the swap depth function to movieclips that have the setmask function implimented to them. the problem is that i can get the swapdepth to work but when the setmask is implimented at the same time the movie clips will not swap depths.

the code that i am using to set the mask is  
\_root.bgmasked.setMask(\_root.dragger); this is on frame one in the action/code layer bgmasked is the imaged being masked by dragger.

the code that i am using to swapDepth is  
on (press, release, dragOver, dragOut) {  
\_root.x +=2;  
\_root.dragger.swapDepths(\_root.x);

}  
this code is placed on the movie clip dragger that is masking bgmasked

if anyone has a clue how i can get this to work full im all ears

thanks in advance
