# Hit test code not working

**URL:** <https://forum.kirupa.com/t/hit-test-code-not-working/219614>\
**Category:** Uncategorized\
**Created:** [March 18, 2007, 6:38pm UTC](https://forum.kirupa.com/t/hit-test-code-not-working/219614 "2007-03-18T18:38:21Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Flashbandit](https://avatars.discourse-cdn.com/v4/letter/f/c2a13f/32.png) [@Flashbandit](https://forum.kirupa.com/u/Flashbandit)\
**Post date:** [March 18, 2007, 6:38pm UTC](https://forum.kirupa.com/t/hit-test-code-not-working/219614/1 "2007-03-18T18:38:21Z")

</div>

onClipEvent(enterFrame) {  
if(\_root.barrierdown.hitTest(this)) {  
this.\_y -= moveSpeed;  
}  
}

what is wrong with this code. im trying to make it so when i hit a barrier, i dont go through it. it is the floor of my game, and i have tried everything i can think of, also, thi is my 1st post here, although i read the forums often. thx for any help 🙂 oops…missed part of it
