# hitTest problem!

**URL:** https://forum.kirupa.com/t/hittest-problem/26715
**Category:** flash
**Created:** [July 25, 2003, 5:02pm UTC](https://forum.kirupa.com/t/hittest-problem/26715 "2003-07-25T17:02:54Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![scarce](https://avatars.discourse-cdn.com/v4/letter/s/65b543/32.png) [@scarce](https://forum.kirupa.com/u/scarce)
#### Post date: [July 25, 2003, 5:02pm UTC](https://forum.kirupa.com/t/hittest-problem/26715/1 "2003-07-25T17:02:54Z")

</div>

ok, i’m having this problem where I want to make a movieclip that i am moving with they arrow pad STOP when it touches another movie clip, ok, thats easy, but how do I still make it move after words…for instance…\_root.guy runs into \_root.desk (desk is shaped like an L) how can he stop, but still move the other 3 ways…PLEASE HELP! THANK 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 25, 2003, 5:13pm UTC](https://forum.kirupa.com/t/hittest-problem/26715/2 "2003-07-25T17:13:15Z")

</div>

use relative posititioning:

if guy.\_y \< desk.\_y  
if guy.\_x \> desk.\_x

etc - adding lots of if’s everwhere

---

<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 25, 2003, 5:17pm UTC](https://forum.kirupa.com/t/hittest-problem/26715/3 "2003-07-25T17:17:28Z")

</div>

hmmm, ok i’ll try that

---

<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 25, 2003, 5:18pm UTC](https://forum.kirupa.com/t/hittest-problem/26715/4 "2003-07-25T17:18:49Z")

</div>

where should I put the coding into? timeline, guy movie clip or desk movie clip?

---

<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 25, 2003, 5:29pm UTC](https://forum.kirupa.com/t/hittest-problem/26715/5 "2003-07-25T17:29:19Z")

</div>

hmmm that doesn’t work, cause the hitTest way I’m using is…

this is placed inside the movieclip on the desk

onClipEvent(EnterFrame)

If(this.hitTest(\_root.guy.\_x,\_root.guy.\_y,true)

---

<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 25, 2003, 5:31pm UTC](https://forum.kirupa.com/t/hittest-problem/26715/6 "2003-07-25T17:31:13Z")

</div>

am I doing it right? what else do I put with that in order to make the object stop when it touches it, yet when I use the other 3 arrows it moves…I’m using that form of hitTest because I don’t want it to stop if it hits a bounding box, only if it hits the actual object…thanks
