# hitTest an array of mc-s

**URL:** <https://forum.kirupa.com/t/hittest-an-array-of-mc-s/330308>\
**Category:** flash\
**Created:** [December 30, 2012, 6:19pm UTC](https://forum.kirupa.com/t/hittest-an-array-of-mc-s/330308 "2012-12-30T18:19:28Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ancerick](https://avatars.discourse-cdn.com/v4/letter/a/3be4f8/32.png) [@ancerick](https://forum.kirupa.com/u/ancerick)\
**Post date:** [December 30, 2012, 6:19pm UTC](https://forum.kirupa.com/t/hittest-an-array-of-mc-s/330308/1 "2012-12-30T18:19:28Z")

</div>

basicly i have a scene where id like to check if any of the names in components array hits with positive\_mc - hitTest seemed to work fine while inside bracets was just a mc name but when its a string it dont seem to seems to return false… althought names are correct (check the trace output) .  
fla can be obtained from :  
fiasko.biz/help/index.fla

the code if u know what im dooing wrong already: stop();  
all\_components\_array = [“op1\_mc”, “op2\_mc”];  
/_needs a full list of movieClipp names used as components in movie as a array_/  
check\_mc.onRelease = function()  
{  
trace(“start”);  
i = 0;  
comarray\_max = all\_components\_array.length  
while (comarray\_max \> i)  
{  
var newtarget:String = all\_components\_array\*  
trace ("mc to be used for test: " + newtarget)  
if (positve\_mc.hitTest(newtarget))  
{  
debugarea\_text.text += “mc\_to hit =” + newtarget + " ";  
trace(“ok2”);  
} else {  
debugarea\_text.text += “mc not to hit =” + newtarget + " ";  
trace(“noup”);  
}  
i++;  
}  
};
