Hitest

okay, i have tried something, so here it is:

i have one movieclip and i have another movieclip>enemy…okay so when the first movieclip goes over the enemy, nothing happens until i roll out! all i want to do is the movieclip, when it hits the enemy, it goes to the enemy’s second frame and that’s it ! there are no syntax error in this script, just something i want to do that apparently doesn’t work right !

here is my code:

 onClipEvent (load) {
speed = 2;
}
onClipEvent (enterFrame) {
if (key.isdown(key.RIGHT)) {
play();
_rotation = 90;
_x+= speed;
}
if (key.isdown(key.LEFT)) {
play();
_rotation = 270;
_x-= speed;
}
if (key.isdown(key.UP)) {
play();
_rotation = 0;
_y-= speed;
}
if (key.isdown(key.DOWN)) {
play();
_rotation = 180;
_y+= speed;
}
if (key.isdown(key.RIGHT) && key.isdown(key.UP)) {
_rotation = 45;
}
if (key.isdown(key.LEFT) && key.isdown(key.UP)) {
_rotation = 315;
}
if (key.isdown(key.RIGHT) && key.isdown(key.DOWN)) {
_rotation = 135;
}
if (key.isdown(key.LEFT) && key.isdown(key.DOWN)) {
_rotation = 225;
}
}
onClipEvent (enterFrame) {
if(this.hitTest(_root.enemy))
{
_root.enemy2.gotoAndPlay(2);
}
}

if someone could help me or give me another code, that would really be nice!:wink:
thank you in advance!