# HitTest?!?PlzHelp

**URL:** <https://forum.kirupa.com/t/hittest-plzhelp/183478>\
**Category:** flash\
**Created:** [March 27, 2006, 1:50pm UTC](https://forum.kirupa.com/t/hittest-plzhelp/183478 "2006-03-27T13:50:54Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![butman](https://avatars.discourse-cdn.com/v4/letter/b/ee7513/32.png) [@butman](https://forum.kirupa.com/u/butman)\
**Post date:** [March 27, 2006, 1:50pm UTC](https://forum.kirupa.com/t/hittest-plzhelp/183478/1 "2006-03-27T13:50:54Z")

</div>

whats wrong with this?  
It wont work!

---

<div class="post-metadata">

**Author:** ![butman](https://avatars.discourse-cdn.com/v4/letter/b/ee7513/32.png) [@butman](https://forum.kirupa.com/u/butman)\
**Post date:** [March 27, 2006, 3:27pm UTC](https://forum.kirupa.com/t/hittest-plzhelp/183478/2 "2006-03-27T15:27:10Z")

</div>

plz It will be wery nice, plz my code is  
onClipEvent (enterFrame) {  
if (this.hitTest(\_root.Test1)) {  
trace(“Jippi”);  
}  
}

---

<div class="post-metadata">

**Author:** ![butman](https://avatars.discourse-cdn.com/v4/letter/b/ee7513/32.png) [@butman](https://forum.kirupa.com/u/butman)\
**Post date:** [March 27, 2006, 4:09pm UTC](https://forum.kirupa.com/t/hittest-plzhelp/183478/3 "2006-03-27T16:09:27Z")

</div>

or, is the code working on your comp?

---

<div class="post-metadata">

**Author:** ![stereochris](https://avatars.discourse-cdn.com/v4/letter/s/f4b2a3/32.png) [@stereochris](https://forum.kirupa.com/u/stereochris)\
**Post date:** [March 27, 2006, 5:09pm UTC](https://forum.kirupa.com/t/hittest-plzhelp/183478/4 "2006-03-27T17:09:14Z")

</div>

It’s because in the HitTest, you have it checking if the circle is hitting “Test1”, while the mc you’re trying to hit is named “test1”. It doesn’t look like it would make a difference, but it is case sensitive, so inside the code on the cirlce, change the code to this…

```auto

onClipEvent (enterFrame) {
 if (this.hitTest(_root.test1)) {
  trace("Jippi");
 }
}

```

yep

---

<div class="post-metadata">

**Author:** ![butman](https://avatars.discourse-cdn.com/v4/letter/b/ee7513/32.png) [@butman](https://forum.kirupa.com/u/butman)\
**Post date:** [March 27, 2006, 6:19pm UTC](https://forum.kirupa.com/t/hittest-plzhelp/183478/5 "2006-03-27T18:19:02Z")

</div>

Thanks, thanks, thanks, thanks and thanks!!!  
but why are this code not so nice?  
onClipEvent (enterFrame) {  
if (this.hitTest(\_root.bomb1)) {  
gotoAndPlay(“GameOver”, 1);

```
}

```

}

---

<div class="post-metadata">

**Author:** ![butman](https://avatars.discourse-cdn.com/v4/letter/b/ee7513/32.png) [@butman](https://forum.kirupa.com/u/butman)\
**Post date:** [March 27, 2006, 6:19pm UTC](https://forum.kirupa.com/t/hittest-plzhelp/183478/6 "2006-03-27T18:19:44Z")

</div>

the gotoandplay is the problem, but why?

---

<div class="post-metadata">

**Author:** ![butman](https://avatars.discourse-cdn.com/v4/letter/b/ee7513/32.png) [@butman](https://forum.kirupa.com/u/butman)\
**Post date:** [March 29, 2006, 3:06pm UTC](https://forum.kirupa.com/t/hittest-plzhelp/183478/7 "2006-03-29T15:06:49Z")

</div>

but why does this don’t work? plz help!!!

```auto
onClipEvent (enterFrame) {
if (this.hitTest(_root.bomb1)) {
gotoAndPlay("GameOver", 1);
}
}

```

---

<div class="post-metadata">

**Author:** ![stereochris](https://avatars.discourse-cdn.com/v4/letter/s/f4b2a3/32.png) [@stereochris](https://forum.kirupa.com/u/stereochris)\
**Post date:** [March 29, 2006, 3:18pm UTC](https://forum.kirupa.com/t/hittest-plzhelp/183478/8 "2006-03-29T15:18:25Z")

</div>

```auto

[LEFT]onClipEvent (enterFrame) {
  if (this.hitTest(_root.bomb1)) {
    gotoAndPlay("GameOver", 1);
  }
}

```

I have no idea why you have a 1 after the name of the frame you want to gotoAndPlay. If anything, try this…

```auto

[LEFT]onClipEvent (enterFrame) {
  if (this.hitTest(_root.bomb1)) {
    gotoAndStop("GameOver");
  }
}

```

and make sure the case of the name of the frame is GameOver, EXACTLY like you have it in the code - Chris[/LEFT]  
[/LEFT]

---

<div class="post-metadata">

**Author:** ![butman](https://avatars.discourse-cdn.com/v4/letter/b/ee7513/32.png) [@butman](https://forum.kirupa.com/u/butman)\
**Post date:** [March 29, 2006, 3:32pm UTC](https://forum.kirupa.com/t/hittest-plzhelp/183478/9 "2006-03-29T15:32:35Z")

</div>

It din’t work. plz can you try to fix it on this file, it would be very nice:panda:
