# HitTest

**URL:** <https://forum.kirupa.com/t/hittest/8599>\
**Category:** flash\
**Created:** [November 24, 2002, 5:00pm UTC](https://forum.kirupa.com/t/hittest/8599 "2002-11-24T17:00:23Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![BullDog\_Flash](https://avatars.discourse-cdn.com/v4/letter/b/d07c76/32.png) [@BullDog\_Flash](https://forum.kirupa.com/u/BullDog_Flash)\
**Post date:** [November 24, 2002, 5:00pm UTC](https://forum.kirupa.com/t/hittest/8599/1 "2002-11-24T17:00:23Z")

</div>

Hey everyone i really need to learn how to do a Multiple hitTest

If i dont i wont be able to make my game…  
SomeOne please help me…

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:** [November 24, 2002, 5:08pm UTC](https://forum.kirupa.com/t/hittest/8599/2 "2002-11-24T17:08:09Z")

</div>

multiple hitTest?  
Whatta ya mean?

---

<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 25, 2002, 1:12am UTC](https://forum.kirupa.com/t/hittest/8599/3 "2002-11-25T01:12:30Z")

</div>

I mean one hitTest for like four MovieClips without writing out hitTest for each MovieClip…

---

<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 25, 2002, 2:48pm UTC](https://forum.kirupa.com/t/hittest/8599/4 "2002-11-25T14:48:07Z")

</div>

sorry for the delay! don’t lose hope!  
maybe there’s a whole different way out of this!  
Why do you need it!  
Are you duplicating movieclips with duplicateMovieClip() and you want to hitTest all of the duplicated mcs?

---

<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 25, 2002, 2:48pm UTC](https://forum.kirupa.com/t/hittest/8599/5 "2002-11-25T14:48:58Z")

</div>

Can’t you make a generic function, then call it as and when you need 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:** [November 25, 2002, 9:15pm UTC](https://forum.kirupa.com/t/hittest/8599/6 "2002-11-25T21:15:37Z")

</div>

Well Thats might work but im not sure how to do Function()

Could someOne teach me…

Or direct me to a good place ot learn it…

Reply soon…

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:** [November 25, 2002, 9:59pm UTC](https://forum.kirupa.com/t/hittest/8599/7 "2002-11-25T21:59:57Z")

</div>

function is easy  
like this:

**randomize** = function() {  
myvar = random(500);  
}

this just ceates a new variable with a random value from 0-500.  
and you can use it like this: (on a button for example)

on(release) {  
**randomize** ();  
}

---

<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 25, 2002, 10:33pm UTC](https://forum.kirupa.com/t/hittest/8599/8 "2002-11-25T22:33:41Z")

</div>

I tried that code a couple of times and got it working on and off ill send an fla and show you wht type of game im making and sow you what i mean by having to put alll kinds of hitTest in it…

There would like be 30 if i finished all of it…

So maybe you guys xcanhelp 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:** [November 25, 2002, 10:34pm UTC](https://forum.kirupa.com/t/hittest/8599/9 "2002-11-25T22:34:51Z")

</div>

Forgot the file:pirate:

---

<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 25, 2002, 10:43pm UTC](https://forum.kirupa.com/t/hittest/8599/10 "2002-11-25T22:43:54Z")

</div>

Forgot the file:pirate:

---

<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 26, 2002, 1:27pm UTC](https://forum.kirupa.com/t/hittest/8599/11 "2002-11-26T13:27:57Z")

</div>

[SIZE=1]echo…[/SIZE]

---

<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 26, 2002, 10:40pm UTC](https://forum.kirupa.com/t/hittest/8599/12 "2002-11-26T22:40:04Z")

</div>

Well sorry i thought i posted it right…

Well i still need a Multiple hittest…

Im making a car game now were you run over people but i need more tgan one hirtTest for it…

Maybe you guys can help…

This time here is the FLA
