# Hitest

**URL:** <https://forum.kirupa.com/t/hitest/53090>\
**Category:** Uncategorized\
**Created:** [May 31, 2004, 4:41am UTC](https://forum.kirupa.com/t/hitest/53090 "2004-05-31T04:41:07Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![nico174](https://avatars.discourse-cdn.com/v4/letter/n/f9ae1b/32.png) [@nico174](https://forum.kirupa.com/u/nico174)\
**Post date:** [May 31, 2004, 4:41am UTC](https://forum.kirupa.com/t/hitest/53090/1 "2004-05-31T04:41:07Z")

</div>

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:

```auto
 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!😉  
thank you in advance!
