# Easy One!, hitTest!

**URL:** https://forum.kirupa.com/t/easy-one-hittest/273797
**Category:** flash
**Created:** [October 21, 2008, 2:26am UTC](https://forum.kirupa.com/t/easy-one-hittest/273797 "2008-10-21T02:26:50Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![DeadRiver](https://avatars.discourse-cdn.com/v4/letter/d/b782af/32.png) [@DeadRiver](https://forum.kirupa.com/u/DeadRiver)
#### Post date: [October 21, 2008, 2:26am UTC](https://forum.kirupa.com/t/easy-one-hittest/273797/1 "2008-10-21T02:26:50Z")

</div>

Edit: ok I got it working, just want to know if this is the best way of hittest in the main timeline

hp = 100

onEnterFrame = function()  
{  
char()  
enemy()  
function char()  
{  
char = attachMovie (“char”, char1, 100);  
}

```
function enemy()
{
    TestEnemy = attachMovie ("TestEnemy", TestEnemy1, 200);
    if(TestEnemy.hitTest(char));
    {
        eHit();
    }
}    

function eHit()
{
    hp -= 1;
}

```

}

Edit2: ok it doesn’t work. Apparently the mcs are always touching with this code.  
frame code is so difficult =(
