# Arranging MC's

**URL:** <https://forum.kirupa.com/t/arranging-mcs/113440>\
**Category:** Uncategorized\
**Created:** [June 17, 2004, 10:07pm UTC](https://forum.kirupa.com/t/arranging-mcs/113440 "2004-06-17T22:07:27Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![joso](https://avatars.discourse-cdn.com/v4/letter/j/b3f665/32.png) [@joso](https://forum.kirupa.com/u/joso)\
**Post date:** [June 17, 2004, 10:07pm UTC](https://forum.kirupa.com/t/arranging-mcs/113440/1 "2004-06-17T22:07:27Z")

</div>

hi,

ok so i have 3 MC’s on the main stage i was just wondering if it’s possible to pull which ever MC to the front when it’s clicked, like you would arrange them if you click ‘Bring To Front’.

All the MC’s are at the same position on the page so when button 1 is clicked mc 1 is at the front, button 2 mc 2…and so on?

does that make sense?

thanks

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [June 17, 2004, 10:41pm UTC](https://forum.kirupa.com/t/arranging-mcs/113440/2 "2004-06-17T22:41:55Z")

</div>

If your movie clips are loaded into levels, you can use

whatever\_mc.swapDepths(instanceName\_to\_swap\_with)  
or  
whatever\_mc.swapDepths(6) //put the depth level instead of 6

If you need 3 MC’s, you are going to need a swapping variable. So when you click the MC, set up the onRelase function to “swap depths” thing, and then change a variable, so you know which MC is on top to swap with.

```auto

//this goes in the main MC timeline
var onTop = "MC1"

//put this in your MC1 loaded movie
whatever.onPress = function () {
_root.MC1_container.swapDepths(onTop+"_container");
_root.onTop = "MC1"
}

//this goes in MC2 loaded movie
whatever2.onPress = function () {
_root.MC2_container.swapDepths(onTop+"_container");
_root.onTop = "MC2"
}

```

That’s the gist of it. If you got any other questions, post. Good Luck!

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [June 17, 2004, 11:40pm UTC](https://forum.kirupa.com/t/arranging-mcs/113440/3 "2004-06-17T23:40:34Z")

</div>

i tried doing what you said but i don’t think i did it right…

i’ve attached the most simple of fla’s with 3 mc’s and 3 buttons in it, each is a different colour so you click the relavant colour to pull it to the front, if you have time could you apply the code in the right places?

i’m not totally sure what i’m doing cause im still abit of a novice :crying:

ok, thanks

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [June 17, 2004, 11:48pm UTC](https://forum.kirupa.com/t/arranging-mcs/113440/4 "2004-06-17T23:48:48Z")

</div>

i tried doing what you said but i don’t think i did it right…

i’ve attached the most simple of fla’s with 3 mc’s and 3 buttons in it, each is a different colour so you click the relavant colour to pull it to the front, if you have time could you apply the code in the right places?

i’m not totally sure what i’m doing cause im still abit of a novice

ok, thanks

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [June 18, 2004, 12:27am UTC](https://forum.kirupa.com/t/arranging-mcs/113440/5 "2004-06-18T00:27:52Z")

</div>

so you don’t have loaded movies??

just paste this code into a frame:

```auto

button1.onPress = function () {
mc1.swapDepths(1);
}

button2.onPress = function () {
mc2.swapDepths(1);
}

button3.onPress = function () {
mc3.swapDepths(1);
}

```

pretty easy. I generally use a layer called “code” that I can put blank MC’s on with AS. Create that and put the code on the first frame in that layer.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [June 18, 2004, 12:39am UTC](https://forum.kirupa.com/t/arranging-mcs/113440/6 "2004-06-18T00:39:33Z")

</div>

that simple ey?

thanks for you help man 🙂
