# Hittest and Gotoandplay

**URL:** <https://forum.kirupa.com/t/hittest-and-gotoandplay/122616>\
**Category:** Uncategorized\
**Created:** [September 15, 2004, 11:00am UTC](https://forum.kirupa.com/t/hittest-and-gotoandplay/122616 "2004-09-15T11:00:40Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![flashy22](https://avatars.discourse-cdn.com/v4/letter/f/848f3c/32.png) [@flashy22](https://forum.kirupa.com/u/flashy22)\
**Post date:** [September 15, 2004, 11:00am UTC](https://forum.kirupa.com/t/hittest-and-gotoandplay/122616/1 "2004-09-15T11:00:40Z")

</div>

Hello all,  
For starters if anyone wants to see the fla i will post it,  
Ok, i did the tutorial on firing ([http://www.kirupa.com/developer/mx/fire.htm](http://www.kirupa.com/developer/mx/fire.htm))  
and i wanted to put in an enemy, that would play when hit,  
basiccly i just quickly drew a rectangle and made it a movieclip,  
i called it enemy, and put its instance name as enemy aswell,  
( the bullets instance name is bullets), then i went into the enemy movieclip and made the first frame stop, and second playing the dying animation, then stopping on the fifth with nothing there. i put this code on the enemy movieclip but it wont work, as i am new to AS i dont really know what is wrong Please help!

onClipEvent(load){  
if (\_root.enemy, hittest(\_root.bullets)) {  
\_root.enemy = gotoAndPlay(2);  
}  
}

thanks alot,  
Ben (flashy22)
