# A hitTest question

**URL:** https://forum.kirupa.com/t/a-hittest-question/24852
**Category:** flash
**Created:** [July 6, 2003, 3:53am UTC](https://forum.kirupa.com/t/a-hittest-question/24852 "2003-07-06T03:53:30Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![cardjorg](https://avatars.discourse-cdn.com/v4/letter/c/a183cd/32.png) [@cardjorg](https://forum.kirupa.com/u/cardjorg)
#### Post date: [July 6, 2003, 3:53am UTC](https://forum.kirupa.com/t/a-hittest-question/24852/1 "2003-07-06T03:53:30Z")

</div>

hello I am making my first game i don’t have very much experience programing I need some help  
any help is very much apreciated

thanks here is the fla attached=)

---

<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 6, 2003, 3:56am UTC](https://forum.kirupa.com/t/a-hittest-question/24852/2 "2003-07-06T03:56:48Z")

</div>

hm… nice fla… what’s supposed to happen? whats not working? :-\

---

<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 6, 2003, 3:59am UTC](https://forum.kirupa.com/t/a-hittest-question/24852/3 "2003-07-06T03:59:53Z")

</div>

its a simple game , when the person gets to the key the person will drag it and when the key hits the door it’s supposed to go to the (“the”) frame

---

<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 6, 2003, 5:30am UTC](https://forum.kirupa.com/t/a-hittest-question/24852/4 "2003-07-06T05:30:57Z")

</div>

Just paste this code on your Key movi clip[AS]onClipEvent (enterFrame) {  
if (this, hitTest(\_root.door)) {  
\_root.gotoAndStop(2);  
}  
}  
[/AS]

---

<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 6, 2003, 5:37am UTC](https://forum.kirupa.com/t/a-hittest-question/24852/5 "2003-07-06T05:37:22Z")

</div>

thanks man  
you’re my heroe

---

<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 6, 2003, 5:41am UTC](https://forum.kirupa.com/t/a-hittest-question/24852/6 "2003-07-06T05:41:38Z")

</div>

😛  
You’re welcome 🙂

---

<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 6, 2003, 6:09am UTC](https://forum.kirupa.com/t/a-hittest-question/24852/7 "2003-07-06T06:09:26Z")

</div>

I have a question about the hitTest syntax: I know [AS]\_root.movieclip.hitTest(\_root.whatever);[/AS] is correct, but what about the comma ? [AS]if (this, hitTest(\_root.door);[/AS] will that work too ? I mean, I know about the dot, but I’m not sure about the comma …

I looked it up in the actionscript dictionary and it didn’t say anything about a comma …

[http://www.macromedia.com/support/flash/action\_scripts/actionscript\_dictionary/actionscript\_dictionary534.html](http://www.macromedia.com/support/flash/action_scripts/actionscript_dictionary/actionscript_dictionary534.html)

---

<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 6, 2003, 6:11am UTC](https://forum.kirupa.com/t/a-hittest-question/24852/8 "2003-07-06T06:11:38Z")

</div>

mmmm  
always learning something new,  
i didn’t know about the dot but  
yes it works with the comma or atleast in  
flash mx

---

<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 6, 2003, 6:29am UTC](https://forum.kirupa.com/t/a-hittest-question/24852/9 "2003-07-06T06:29:07Z")

</div>

Voetsjoeba, I actually meant to use “.” but i accidentaly used “,”  
Cant explain dat too :-\

---

<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 9, 2003, 5:49pm UTC](https://forum.kirupa.com/t/a-hittest-question/24852/10 "2003-07-09T17:49:27Z")

</div>

i have updated you thing for you

---

<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 9, 2003, 7:20pm UTC](https://forum.kirupa.com/t/a-hittest-question/24852/11 "2003-07-09T19:20:46Z")

</div>

thanks alot i apreciated :trout: :beam:
