# Keeping a movie clip always at the top (z-index)

**URL:** <https://forum.kirupa.com/t/keeping-a-movie-clip-always-at-the-top-z-index/273826>\
**Category:** flash\
**Created:** [October 21, 2008, 12:29pm UTC](https://forum.kirupa.com/t/keeping-a-movie-clip-always-at-the-top-z-index/273826 "2008-10-21T12:29:36Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![atype](https://avatars.discourse-cdn.com/v4/letter/a/958977/32.png) [@atype](https://forum.kirupa.com/u/atype)\
**Post date:** [October 21, 2008, 12:29pm UTC](https://forum.kirupa.com/t/keeping-a-movie-clip-always-at-the-top-z-index/273826/1 "2008-10-21T12:29:36Z")

</div>

Hi,

I’m using:

var maxIndex:Number = this.numChildren - 1;

a.addEventListener(MouseEvent.MOUSE\_OVER, sendToTop );  
…  
…  
z.addEventListener(MouseEvent.MOUSE\_OVER, sendToTop );

function sendToTop(e:Event):void  
{  
this.setChildIndex(e.currentTarget as MovieClip, maxIndex);  
}

to send each mc to the top when moused over, in a grid style gallery, but now i’d like to keep another mc at the very top of the z-index so it always shows over the top of the others, I just can’t keep the other mcs from always jumping over. Can anyone point me in the direction of a fix for this - (yes I’m new to AS3…🙂

Thanks
