# Hit Test Problem, Please help

**URL:** <https://forum.kirupa.com/t/hit-test-problem-please-help/325786>\
**Category:** flash\
**Created:** [November 4, 2011, 10:32am UTC](https://forum.kirupa.com/t/hit-test-problem-please-help/325786 "2011-11-04T10:32:13Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![raphaelle](https://avatars.discourse-cdn.com/v4/letter/r/7bcc69/32.png) [@raphaelle](https://forum.kirupa.com/u/raphaelle)\
**Post date:** [November 4, 2011, 10:32am UTC](https://forum.kirupa.com/t/hit-test-problem-please-help/325786/1 "2011-11-04T10:32:13Z")

</div>

if (\_hero.hitTestObject(\_mountain))  
{  
trace(“they hit”);  
\_hero.gotoAndStop(‘walking’);  
\_hero.x+=5;

```
		}

```

if (\_hero.slash.hitTestObject(\_enemy))

```
	        {
				trace("they hit");
				_hero.gotoAndStop('idle');
				_enemy.visible = false;
							
		}

```

i know that the second if statement is wrong cuz I definitely don’t know the right code  
when the hero attacks/slash the enemy the enemy will disappear .

sorry for disturbance but i hope you guys can help .

thnks in advance !

-raphaelle
