# \[MX\] hitTest Help!

**URL:** https://forum.kirupa.com/t/mx-hittest-help/22300
**Category:** flash
**Created:** [June 2, 2003, 12:07pm UTC](https://forum.kirupa.com/t/mx-hittest-help/22300 "2003-06-02T12:07:04Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Keith130](https://avatars.discourse-cdn.com/v4/letter/k/b38774/32.png) [@Keith130](https://forum.kirupa.com/u/Keith130)
#### Post date: [June 2, 2003, 12:07pm UTC](https://forum.kirupa.com/t/mx-hittest-help/22300/1 "2003-06-02T12:07:04Z")

</div>

Im using some actionscript in a button, it uses the **on(keypress “\< HOME \>”)** actionscript. Then it checks if a MC called **neo** has come into contact with an MC called **openDoorE**. It should then play an MC called **wallEDoor**. But it opens it regradless of whether **neo** has hit **openDoorE**. Here is the code im using.

_on(keyPress “\<Home\>”){  
if(\_root.neo, hitTest(\_root.openDoorE)){  
\_root.wallEDoor.play();  
\_root.switchDoorEhandle.nextFrame();  
}  
}_

Help appricated!?!?!?!

:thumb:

---

<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: [June 2, 2003, 12:08pm UTC](https://forum.kirupa.com/t/mx-hittest-help/22300/2 "2003-06-02T12:08:53Z")

</div>

in the \*\* on(keypress “”) \*\* there should be the HOME key but because it has HTML tags round it in the actionscript it didny show up

---

<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: [June 2, 2003, 12:21pm UTC](https://forum.kirupa.com/t/mx-hittest-help/22300/3 "2003-06-02T12:21:32Z")

</div>

your hitTest is wrong… try this instead:

```auto
if (_root.neo.hitTest(_root.openDoorE)) {

```

by the way, welcome to kirupa forum!! =)

---

<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: [June 2, 2003, 12:31pm UTC](https://forum.kirupa.com/t/mx-hittest-help/22300/4 "2003-06-02T12:31:46Z")

</div>

Thanx for the help Kax

---

<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: [June 2, 2003, 12:34pm UTC](https://forum.kirupa.com/t/mx-hittest-help/22300/5 "2003-06-02T12:34:47Z")

</div>

no problem, keith. =)
