# HitTesting MC's From Libary Need Help \[FL8\]

**URL:** https://forum.kirupa.com/t/hittesting-mcs-from-libary-need-help-fl8/313642
**Category:** flash
**Created:** [September 5, 2010, 10:34pm UTC](https://forum.kirupa.com/t/hittesting-mcs-from-libary-need-help-fl8/313642 "2010-09-05T22:34:45Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![CodeRed](https://avatars.discourse-cdn.com/v4/letter/c/aeb1de/32.png) [@CodeRed](https://forum.kirupa.com/u/CodeRed)
#### Post date: [September 5, 2010, 10:34pm UTC](https://forum.kirupa.com/t/hittesting-mcs-from-libary-need-help-fl8/313642/1 "2010-09-05T22:34:45Z")

</div>

I’ve got a game where I need the enemys to hitTest with each other, I’m going to have copys of 3 types of enemys on the stage, instead of giving them all an instance name is it possible to hittest from the libary because I’ve given them instance names in the library of “enemya” “enemyb” “enemyc”

The code I have got didn’t work which was -

```auto
 
onClipEvent(enterFrame){
 if(this.hitTest(_root.enemyc)){
  trace("true")
 }
  if(this.hitTest(_root.enemyb)){
  trace("true")
 }
  if(this.hitTest(_root.enemya)){
  trace("true")
 }
}

```

So then I tryed using a multi-dimentional array (for the first time) but I don’t think I got that right either…

```auto
 
onClipEvent(enterFrame){
 if(this.hitTest(_root.test[0])){
  trace("true")
 }
}

```

That was on the instance of enemy.

```auto
 
_root.test = new Array();
_root.test[0] = [_root.enemya, _root.enemyb, _root.enemyc];

```

That was on the frame.

Can anyone modify or do a new code for hittesting by enemies please. Thanks in advance 🙂
