# HITTEST with 'n' clips

**URL:** https://forum.kirupa.com/t/hittest-with-n-clips/26549
**Category:** flash
**Created:** [July 24, 2003, 12:42am UTC](https://forum.kirupa.com/t/hittest-with-n-clips/26549 "2003-07-24T00:42:57Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![The\_Vulcan](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/the_vulcan/32/145_2.png) [@The\_Vulcan](https://forum.kirupa.com/u/The_Vulcan)
#### Post date: [July 24, 2003, 12:42am UTC](https://forum.kirupa.com/t/hittest-with-n-clips/26549/1 "2003-07-24T00:42:57Z")

</div>

Action Script Dictionary example.

if( \_root.ball, hittest (\_root.square) ){

}

However what happens if you have ‘n’ amount of clips.  
how to you get hittest to == true if (\_root.???) could be anything.

thanks.

---

<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: [July 24, 2003, 2:49am UTC](https://forum.kirupa.com/t/hittest-with-n-clips/26549/2 "2003-07-24T02:49:26Z")

</div>

how bout you just have all n objects hitTest with that one object? 🙂

probably not very efficient, but it’ll get the ball rolling.

---

<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: [July 24, 2003, 3:07am UTC](https://forum.kirupa.com/t/hittest-with-n-clips/26549/3 "2003-07-24T03:07:31Z")

</div>

ok still need help.

Say I was to do a snow flake scene. But if 2 flakes collied they break into 4.

The problem is I dont know which ones will touch, and there could be 100 different flakes. flake1, flake2, flake99.

I duplicate a flake movie giving each its own name.

i = i + 1;  
duplicateMovieClip (\_root.flake, “flake” + i, i);

now that I could have 50 flakes on the screen with different names, how can I hit test them all.

if (\_root.flake n, hitTest( flake n) )

I dont have a clue.

---

<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: [July 24, 2003, 3:25am UTC](https://forum.kirupa.com/t/hittest-with-n-clips/26549/4 "2003-07-24T03:25:45Z")

</div>

[http://www.macromedia.com/devnet/mx/flash/articles/asteroids.html](http://www.macromedia.com/devnet/mx/flash/articles/asteroids.html)

OK I found this asteroids game.

somewhere in it should be my answer, I think…

---

<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: [August 2, 2003, 3:05pm UTC](https://forum.kirupa.com/t/hittest-with-n-clips/26549/5 "2003-08-02T15:05:30Z")

</div>

did u ever find an answer?

---

<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: [August 2, 2003, 5:46pm UTC](https://forum.kirupa.com/t/hittest-with-n-clips/26549/6 "2003-08-02T17:46:20Z")

</div>

I had a problem with that one making a game that has been on here a couple times before I put it up (beacause I couldn’t get it to work) However, on the end of this post, there is a zip file with a game called Galaxia on it that uses hitTest on duplicated movieClips. Basically the hitTest asks for an array - I don’t do arrays yet, but your answers in that game:

[http://www.kirupaforum.com/forums/showthread.php?s=&threadid=25422&perpage=15&highlight=hittest&pagenumber=3](http://www.kirupaforum.com/forums/showthread.php?s=&threadid=25422&perpage=15&highlight=hittest&pagenumber=3)

Hope that helps, it’s a little out of my understanding right now.

[edit]Yeldarb, lol that PMS line is messed up, but funny!!

---

<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: [August 2, 2003, 9:53pm UTC](https://forum.kirupa.com/t/hittest-with-n-clips/26549/7 "2003-08-02T21:53:28Z")

</div>

if it’s out of ur understanding, it’s out of mine… ur way better at flash than me… can someone explain it?

---

<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: [August 5, 2003, 9:25pm UTC](https://forum.kirupa.com/t/hittest-with-n-clips/26549/8 "2003-08-05T21:25:17Z")

</div>

come on, i know someone knows how to do this??!!  
please help me!! 🙂

---

<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: [August 7, 2003, 9:02pm UTC](https://forum.kirupa.com/t/hittest-with-n-clips/26549/9 "2003-08-07T21:02:03Z")

</div>

please, i really need to know how to do this…?  
i know one of you flash gurus knows how…  
senucular? lostinbeta? kirupa? claudio? someone else?  
thanks

---

<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: [August 9, 2003, 6:10pm UTC](https://forum.kirupa.com/t/hittest-with-n-clips/26549/10 "2003-08-09T18:10:49Z")

</div>

ok, guess not… i think i may start a new thread??..

---

<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: [August 21, 2003, 7:14pm UTC](https://forum.kirupa.com/t/hittest-with-n-clips/26549/11 "2003-08-21T19:14:25Z")

</div>

Yeah sorry i didn’t answer you Yeldarb i stopped recieving emails from this thread.

I put that in the to hard basket to come back to later.
