# Drag and drop +hittest

**URL:** <https://forum.kirupa.com/t/drag-and-drop-hittest/279168>\
**Category:** Uncategorized\
**Created:** [January 10, 2009, 1:40pm UTC](https://forum.kirupa.com/t/drag-and-drop-hittest/279168 "2009-01-10T13:40:08Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![gencoglu](https://avatars.discourse-cdn.com/v4/letter/g/898d66/32.png) [@gencoglu](https://forum.kirupa.com/u/gencoglu)\
**Post date:** [January 10, 2009, 1:40pm UTC](https://forum.kirupa.com/t/drag-and-drop-hittest/279168/1 "2009-01-10T13:40:08Z")

</div>

[FONT=Courier New][SIZE=2]Hi,  
I have five MCs on the stage. I drag them to create a hitTest but there is  
something wrong with my code?  
Any idea?  
thanks

```php

myArray=new Array(m1,m2,m3,m4,m5);
for(i=0; i<=myArray.length; i++){
myArray*.onPress=function(){
this.startDrag();
}
myArray*.onRelease=function(){
this.stopDrag();
}
if(_root["m"+i].hitTest(this))
{
_root.kutu.text="it is hitting";
}else{
_root.kutu.text="no hitting";

}
}

```

[/SIZE][/FONT]
