# \[FMX04\]swapDepth issue. Help Please!

**URL:** <https://forum.kirupa.com/t/fmx04-swapdepth-issue-help-please/199543>\
**Category:** Uncategorized\
**Created:** [September 3, 2006, 9:25pm UTC](https://forum.kirupa.com/t/fmx04-swapdepth-issue-help-please/199543 "2006-09-03T21:25:14Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dokratos](https://avatars.discourse-cdn.com/v4/letter/d/4da419/32.png) [@Dokratos](https://forum.kirupa.com/u/Dokratos)\
**Post date:** [September 3, 2006, 9:25pm UTC](https://forum.kirupa.com/t/fmx04-swapdepth-issue-help-please/199543/1 "2006-09-03T21:25:14Z")

</div>

Here’s the problem. I’m building a site and in one Scene I have 3 mc that I are supposed to change depth each time they are selected. Making the selected one come to the top of the others. So far no problems. The problems start when I press the a button to change to another Scene. If I do this after pressing the mc when I change Scene the mc don’t disapear with the rest of the scene they belong in.  
Can anyone help me with this?

order = 101;  
function initObject(myObject) {  
\_root[myObject].onPress = function() {  
order += 2;  
\_root[myObject].swapDepths(order);  
\_root[myObject].startDrag();  
};  
\_root[myObject].onRelease = function() {  
\_root[myObject].stopDrag();  
};  
}  
initObject(“Object\_1”);  
initObject(“Object\_2”);  
initObject(“Object\_3”);
