# SwapDepth multi-instance prob

**URL:** <https://forum.kirupa.com/t/swapdepth-multi-instance-prob/32826>\
**Category:** Uncategorized\
**Created:** [October 11, 2003, 9:04pm UTC](https://forum.kirupa.com/t/swapdepth-multi-instance-prob/32826 "2003-10-11T21:04:18Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![chriso20](https://avatars.discourse-cdn.com/v4/letter/c/ba8739/32.png) [@chriso20](https://forum.kirupa.com/u/chriso20)\
**Post date:** [October 11, 2003, 9:04pm UTC](https://forum.kirupa.com/t/swapdepth-multi-instance-prob/32826/1 "2003-10-11T21:04:18Z")

</div>

Hey i have a RPG game in the making, and i have a character who can walk in 8 directions.

I can do hitTests etc…

but when i found this TUT on swapDepths i was amazed!

so i gave it a go. worked fine on same instance (or \_root)

but cant get it to work through diff. instaces;  
eg.  
instance called “world” has the character in and an object1.  
instance called “stuff” has an object2.

all have  
"  
onClipEvent (enterFrame) {  
this.swapDepths(this.\_y);  
}  
"  
but the depth only works on “object1” not “object2”

PLEASE HELP!
