# Collision-detection between dynamically named movieclips

**URL:** https://forum.kirupa.com/t/collision-detection-between-dynamically-named-movieclips/52549
**Category:** flash
**Created:** [May 25, 2004, 5:07am UTC](https://forum.kirupa.com/t/collision-detection-between-dynamically-named-movieclips/52549 "2004-05-25T05:07:34Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![MrFlashALot](https://avatars.discourse-cdn.com/v4/letter/m/cdc98d/32.png) [@MrFlashALot](https://forum.kirupa.com/u/MrFlashALot)
#### Post date: [May 25, 2004, 5:07am UTC](https://forum.kirupa.com/t/collision-detection-between-dynamically-named-movieclips/52549/1 "2004-05-25T05:07:34Z")

</div>

Hi there,

I have a movieclip (myMC) that I create several instances of.

I dont duplicate the movieclips, but just copy and rename them like “myMC\_i”, where “i” is a unique number.

Can I somehow check if one copy of myMC (for instance “myMC\_2”) collides with another copy (for instance “myMC\_5”), always ignoring collisions with other types of movieclips on the stage?

Thats the problem I cant solve. I can either check for a collision with ANY other movieclip, or check for a collision with a single SPECIFIED movieclip (by checking for its name).  
But I dont know how to check for a collision with a group of movieclips that has the first part of their names in common. If it had been like in a search-engine, you would have been able to search for:

myMC\_1.hitTest(“myMC\_” + \*);

…where the star (\*) is any number (or letter too, for that matter).

Sorry about the rant, but hope somebody still understands enough of what Ive said to help me.
