# Collision detections for multiple mc

**URL:** <https://forum.kirupa.com/t/collision-detections-for-multiple-mc/304615>\
**Category:** flash\
**Created:** [February 10, 2010, 8:44pm UTC](https://forum.kirupa.com/t/collision-detections-for-multiple-mc/304615 "2010-02-10T20:44:56Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Matrix015](https://avatars.discourse-cdn.com/v4/letter/m/ce7236/32.png) [@Matrix015](https://forum.kirupa.com/u/Matrix015)\
**Post date:** [February 10, 2010, 8:44pm UTC](https://forum.kirupa.com/t/collision-detections-for-multiple-mc/304615/1 "2010-02-10T20:44:56Z")

</div>

I am trying to create collision detection between mcs without having to write the code 10 times.  
I thought this would work but it gives me this error:

TypeError: Error #1034: Type Coercion failed: cannot convert “crisisAnimation” to flash.display.MovieClip.  
at ImagineServicesText2\_fla::MainTimeline/hitTester()

```auto
var target_mc:Array = new Array();
var numTextBoxes:Number;
target_mc = ["crisisAnimation","eventTextAnimation","mediaRelationsAnimation", "mediaAnimation", "graphicAnimation", "webAnimation", "advertisingAnimation"]; 
// 
function hitTester(event:Event):void { 
numTextBoxes = target_mc.length; 
for (var i:int =0; i<numTextBoxes; i++) { 
var textA:MovieClip = target_mc*}; 
for (var j:int =i+1; j<numTextBoxes; j++) { 
var textB:MovieClip = target_mc[j]}; 
//temp_A = eval(textA); 
//temp_B = eval(textB); 
if (textA.hitTestObject(textB)) { 
trace ("Hit!"); 
}
}
this.addEventListener (Event.ENTER_FRAME, hitTester); 

```
