# Overlapping movie clips

**URL:** <https://forum.kirupa.com/t/overlapping-movie-clips/171600>\
**Category:** Uncategorized\
**Created:** [December 6, 2005, 8:07pm UTC](https://forum.kirupa.com/t/overlapping-movie-clips/171600 "2005-12-06T20:07:04Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![onecommoncode](https://avatars.discourse-cdn.com/v4/letter/o/47e85d/32.png) [@onecommoncode](https://forum.kirupa.com/u/onecommoncode)\
**Post date:** [December 6, 2005, 8:07pm UTC](https://forum.kirupa.com/t/overlapping-movie-clips/171600/1 "2005-12-06T20:07:04Z")

</div>

[size=1]I have 2 movie clips each with the code:

onClipEvent(mouseDown){  
if(hitTest(\_root.\_xmouse,\_root.\_ymouse)){  
this.startDrag(false);  
}  
}  
onClipEvent(mouseUp){  
stopDrag();  
}

which allows me to drag them around the screen. How can I get it so that if they are overlapping, when I click on the bottom movie clip it will automatically bring it to the front?[/size]
