Hittest and Gotoandplay

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)
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)

[color=green]wrong syntax…[/color]


onClipEvent(load){ 
if (_root.enemy[color=red].[/color]hit[color=red]T[/color]est(_root.bullets)) {
	 _root.enemy[color=red].[/color]gotoAndPlay(2);
}
}

No that didnt work, and i accidently, got it wrong, its instance is bullet, ill post the .fla if you need to see it,
please help,
Ben (flashy22)

onClipEvent (load) is executed only when your mc loads for the first time.
my guess is that you’d want and
onClipEvent(enterFrame)

No unfortunalty that didnt work either!
thanks in advance,
Ben (flashy22)

did you try just putting the if statement inside the movie clip?

// root frame 5

if (_root.enemy.hitTest(_root.bullets)) {
_root.enemy.gotoAndPlay(2);
}
_root.gotoAndPlay(4);