# \[FMX\] Dup'd movieClip hitTest problems!

**URL:** https://forum.kirupa.com/t/fmx-dupd-movieclip-hittest-problems/35632
**Category:** Uncategorized
**Created:** [November 16, 2003, 5:03am UTC](https://forum.kirupa.com/t/fmx-dupd-movieclip-hittest-problems/35632 "2003-11-16T05:03:31Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![CrippledMonkey](https://avatars.discourse-cdn.com/v4/letter/c/e5b9ba/32.png) [@CrippledMonkey](https://forum.kirupa.com/u/CrippledMonkey)
#### Post date: [November 16, 2003, 5:03am UTC](https://forum.kirupa.com/t/fmx-dupd-movieclip-hittest-problems/35632/1 "2003-11-16T05:03:31Z")

</div>

Alright, im still new to flash and i’ve been tryin to make a basic shooting game (like galaxian, but a whole lot simpler…)

What i’ve gotten so far is the ship, the bullet, and the rock, they’re all fully functional. I have the bullet movieClip to duplicate with a new number (n) attached to it. But i cant figure out how to get the hitTest to work when the rock hits ANY ONE of the bullet movie clips… :-\

Ive gotten it to work by just duplicating the bullet movie clip with “2” on the end and it works, but that only allows for one bullet. . . I have a feeling that im messin up with my hitTest on the rock. . . If you know of way to help it’d be GREAT. Thx

here’s the duplicateMC code:

on (press, keyPress"\<Space\>") {  
ship\_x = getProperty("/ship",\_x);  
ship\_y = getProperty("/ship",\_y);

```
duplicateMovieClip("/laser","laser" add n,n);
setProperty("/laser" add n, _x, ship_x);
setProperty("/laser" add n, _y, ship_y);

```

}

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [November 16, 2003, 2:08pm UTC](https://forum.kirupa.com/t/fmx-dupd-movieclip-hittest-problems/35632/2 "2003-11-16T14:08:05Z")

</div>

Check the for…in loops: [http://www.kirupa.com/developer/actionscript/tricks/forin.htm](http://www.kirupa.com/developer/actionscript/tricks/forin.htm)
