# \[FMX-04\] hitTest & duplicateMovieClip

**URL:** <https://forum.kirupa.com/t/fmx-04-hittest-duplicatemovieclip/105517>\
**Category:** Uncategorized\
**Created:** [March 26, 2004, 10:02pm UTC](https://forum.kirupa.com/t/fmx-04-hittest-duplicatemovieclip/105517 "2004-03-26T22:02:24Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![MZA](https://avatars.discourse-cdn.com/v4/letter/m/f6c823/32.png) [@MZA](https://forum.kirupa.com/u/MZA)\
**Post date:** [March 26, 2004, 10:02pm UTC](https://forum.kirupa.com/t/fmx-04-hittest-duplicatemovieclip/105517/1 "2004-03-26T22:02:24Z")

</div>

Hello!

Ok, i got a hitTest & duplicateMovieClip combined question.  
I got this object that i want to noticed hitTest with this MC called daligObjekt. My problem is that daligObjekt is duplicated very often and it gets a +k in its new instance name, so when i do the hitTest it obviously doesnt rcognize it. I do know u can write +k in the hitTest line aswell but as k number raises faster then the hitTest is done it doesnt help me in this situation. I know that u can “lure” the system by puting an invisible MC that will always attach to the new duplicated movies but i belive there should be an easier answer. If anyone got any ideas, which i bet many do, pls dont hesitate to post it! Thanks a bunch!

Regards  
-MZA  
PS. below some AS code if u didnt understand the problem, u might get a hint with the code…!

[AS]  
onClipEvent(enterFrame){   
\_root.dalig = \_root.kroko.krokoHuvud.hitTest(\_root.daligObjekt);  
}

onClipEvent(enterFrame){  
if(\_root.dalig == true){  
…  
}  
}  
[/AS]  
AND prototype called very often:  
[AS]  
MovieClip.prototype.slumpa = function(){  
duplicateMovieClip(\_root.daligObjekt, “daligObjekt” + k, daligSlumpTal);  
}

[/AS]
