# Help with hitTest

**URL:** <https://forum.kirupa.com/t/help-with-hittest/259063>\
**Category:** Uncategorized\
**Created:** [April 30, 2008, 7:33pm UTC](https://forum.kirupa.com/t/help-with-hittest/259063 "2008-04-30T19:33:57Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![drumthumpa](https://avatars.discourse-cdn.com/v4/letter/d/cc9497/32.png) [@drumthumpa](https://forum.kirupa.com/u/drumthumpa)\
**Post date:** [April 30, 2008, 7:33pm UTC](https://forum.kirupa.com/t/help-with-hittest/259063/1 "2008-04-30T19:33:57Z")

</div>

So I’m working on a game for a class and since it is in actionscript, a lot of the work is independent. So my game basically consists of a bike character riding around and avoiding obstacles. My script looks like this:

onClipEvent (enterFrame) {  
if (\_root.bike, hitTest (\_root.obstacle)){  
\_visible = false;  
}  
}

This script works, but when I replace the visible statement to gotoAndPlay it doesn’t work.

onClipEvent (enterFrame) {  
if (\_root.bike, hitTest (\_root.obstacle)){  
gotoAndPlay (“gameover” , 1);  
}  
}

I really don’t know what to do and I hope you guys can help.
