# Keeping Navigation Movie Clip on Top

**URL:** <https://forum.kirupa.com/t/keeping-navigation-movie-clip-on-top/182896>\
**Category:** flash\
**Created:** [March 22, 2006, 9:04am UTC](https://forum.kirupa.com/t/keeping-navigation-movie-clip-on-top/182896 "2006-03-22T09:04:33Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![trafford87](https://avatars.discourse-cdn.com/v4/letter/t/e0b2c6/32.png) [@trafford87](https://forum.kirupa.com/u/trafford87)\
**Post date:** [March 22, 2006, 9:04am UTC](https://forum.kirupa.com/t/keeping-navigation-movie-clip-on-top/182896/1 "2006-03-22T09:04:33Z")

</div>

Hi Guys

Im working on building a Flash site where i will be loading in external swf’s.

I want to create a navigation mc that contains a map that can be loaded on top of any other loaded swf’s to allow users to chose what mc to load ie, about section, client section etc.

Im fairly new to AS and setting layer depths so im having some difficultly,

Can anyone help?

Cheers

---

<div class="post-metadata">

**Author:** ![NovemberRain](https://avatars.discourse-cdn.com/v4/letter/n/73ab20/32.png) [@NovemberRain](https://forum.kirupa.com/u/NovemberRain)\
**Post date:** [March 22, 2006, 12:58pm UTC](https://forum.kirupa.com/t/keeping-navigation-movie-clip-on-top/182896/2 "2006-03-22T12:58:59Z")

</div>

> [@trafford87](#):
>
> Hi Guys
> 
> Im working on building a Flash site where i will be loading in external swf’s.
> 
> I want to create a navigation mc that contains a map that can be loaded on top of any other loaded swf’s to allow users to chose what mc to load ie, about section, client section etc.
> 
> Im fairly new to AS and setting layer depths so im having some difficultly,
> 
> Can anyone help?
> 
> Cheers

hi your question sounds interesting …so i made sample for that. pls check the attached zip file. Actually I did it using swapDepths () method. Just create a function and compare the depths of each movie clip and interchange values. It is roughly made but hopefully you can understand what i did.  
This is function used for interchange the values. Plz note that every objects on the stage is dynamically attached.  
function exchangeDepth (clip1, clip2, attachClip)  
{  
\_root.holderExternal.loadMovie (attachClip);

// trace(clip1.getDepth());  
// trace(clip2.getDepth());  
if(clip1.getDepth() \> clip2.getDepth()) {  
clip1.swapDepths(clip2);  
}

}

//Enjoy C:-)
