# If statement combines with swapDepths?

**URL:** <https://forum.kirupa.com/t/if-statement-combines-with-swapdepths/293887>\
**Category:** flash\
**Created:** [August 5, 2009, 12:44pm UTC](https://forum.kirupa.com/t/if-statement-combines-with-swapdepths/293887 "2009-08-05T12:44:14Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![scotia2k6](https://avatars.discourse-cdn.com/v4/letter/s/8edcca/32.png) [@scotia2k6](https://forum.kirupa.com/u/scotia2k6)\
**Post date:** [August 5, 2009, 12:44pm UTC](https://forum.kirupa.com/t/if-statement-combines-with-swapdepths/293887/1 "2009-08-05T12:44:14Z")

</div>

Hello folks - hope you are all well! Ive mentioned before Im a useless coder & cobble things together from tutorials & help files - so forgive the laughable & inelegant code!

I have two mc’s (qrfc\_mc & breeders\_mc) & at the mo’ they are draggable\_mcs, with a wee drag effect & when let go, the active one stays on top (which is what I want).  
This works so far, but Id like to add an if statement, along the lines of  
"if qrfc\_mc is at the highest level, then qrfcInfo\_mc gotoAndPlay…etc.  
Ive tried combining if statements Ive used before, but Im struggling - any pointers would be super!

This is what Ive got so far, (stop sniggering at the back!)…_grins_

```auto
 
qrfc_mc.onPress=function(){
startDrag(this);
qrfc_mc.gotoAndPlay("curl");
}
qrfc_mc.onRelease=qrfc_mc.onReleaseOutside=function(){
qrfc_mc.swapDepths(1);
stopDrag();
qrfc_mc.gotoAndPlay("flat");
}
breeders_mc.onPress=function(){
startDrag(this);
breeders_mc.gotoAndPlay("curl");
}
breeders_mc.onRelease=breeders_mc.onReleaseOutside=function(){
breeders_mc.swapDepths(1);
stopDrag();
breeders_mc.gotoAndPlay("flat");
}

```

Thanks so much for reading,  
scotia 😉

…going through livedocs - could I use:

```auto
 
this.swapDepths ( this._parent.getNextHighestDepth( ) ); 

```

& try to cobble an if stamement to that?.._sigh_ - I get so frustrated at myself! Thanks folks,

scotia 😉
