# hitTest problems with nested clips

**URL:** https://forum.kirupa.com/t/hittest-problems-with-nested-clips/19291
**Category:** flash
**Created:** [April 26, 2003, 3:56am UTC](https://forum.kirupa.com/t/hittest-problems-with-nested-clips/19291 "2003-04-26T03:56:03Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![jinky0422](https://avatars.discourse-cdn.com/v4/letter/j/cc9497/32.png) [@jinky0422](https://forum.kirupa.com/u/jinky0422)
#### Post date: [April 26, 2003, 3:56am UTC](https://forum.kirupa.com/t/hittest-problems-with-nested-clips/19291/1 "2003-04-26T03:56:03Z")

</div>

i have 2 clips, player and enemy. each has another clip in it called hitbox

on the enemy clip’s hitbox clip i have:

this.onEnterFrame = function(){  
if(this.hitTest(this.\_parent.\_parent.player.hitbox.\_x, this.\_parent.\_parent.player.hitbox.\_y,true)){  
//do whatever  
}  
}

weird thing is, it won’t register a hit, but if i do a hitTest without the ‘x,y,true’, it detects a hit

---

<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: [April 26, 2003, 4:28pm UTC](https://forum.kirupa.com/t/hittest-problems-with-nested-clips/19291/2 "2003-04-26T16:28:33Z")

</div>

is this what you are looking for?

---

<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: [April 27, 2003, 6:41am UTC](https://forum.kirupa.com/t/hittest-problems-with-nested-clips/19291/3 "2003-04-27T06:41:44Z")

</div>

uh, no

there are 2 clips that have hitbox clips inside of each other

the nested hitbox won’t register a hit if i try to use the hitTest(x,y,true) method, but does if i use hiTest(obj)

---

<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: [April 27, 2003, 6:44am UTC](https://forum.kirupa.com/t/hittest-problems-with-nested-clips/19291/4 "2003-04-27T06:44:48Z")

</div>

instead of using this.\_parent.\_parent. blah blah can’t you use the relative paths?

\_root.clip.otherClip. what ever?

just a thought

---

<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: [April 28, 2003, 2:41am UTC](https://forum.kirupa.com/t/hittest-problems-with-nested-clips/19291/5 "2003-04-28T02:41:42Z")

</div>

i could, but that gives the same result
