# hitTest not working

**URL:** <https://forum.kirupa.com/t/hittest-not-working/250947>\
**Category:** Uncategorized\
**Created:** [February 3, 2008, 10:41pm UTC](https://forum.kirupa.com/t/hittest-not-working/250947 "2008-02-03T22:41:19Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![eabigelow](https://avatars.discourse-cdn.com/v4/letter/e/eada6e/32.png) [@eabigelow](https://forum.kirupa.com/u/eabigelow)\
**Post date:** [February 3, 2008, 10:41pm UTC](https://forum.kirupa.com/t/hittest-not-working/250947/1 "2008-02-03T22:41:19Z")

</div>

Hi–

I am using the following script to set up a hitTest. The basic hitTest works fine, but the second part of the if statement (&& (\_root.w2.\_currentframe==1||2)–see below) doesn’t have any effect. I am trying to set limitations on the hitTest so that “this.responsew1” only moves to the next frame if both conditions of the if statement are met.

I must be doing something wrong, but lord help me, I don’t see what!

Can anyone help? It would be greatly appreciated!!!

onClipEvent (enterFrame) {  
if (this.hitTest(\_root.w2) && (\_root.w2.\_currentframe==1||2)) {  
with (this.responsew1) {  
if (\_currentframe == 1) {  
gotoAndPlay(2); }  
}  
}  
}
