# Variable hittests

**URL:** <https://forum.kirupa.com/t/variable-hittests/272442>\
**Category:** Uncategorized\
**Created:** [October 5, 2008, 9:48am UTC](https://forum.kirupa.com/t/variable-hittests/272442 "2008-10-05T09:48:05Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![stupidsaint](https://avatars.discourse-cdn.com/v4/letter/s/258eb7/32.png) [@stupidsaint](https://forum.kirupa.com/u/stupidsaint)\
**Post date:** [October 5, 2008, 9:48am UTC](https://forum.kirupa.com/t/variable-hittests/272442/1 "2008-10-05T09:48:05Z")

</div>

i have a load of script that summons a bullet

function shoot() {  
mc = \_root.attachMovie(“bullet”, “bullet”+\_root.bullet, \_root.bullet++);  
mc.\_x = ship.\_x;  
mc.\_y = ship.\_y;  
}

so i have summoned the bullet.

now i have an enemy

function spawnEnemy() {  
enemy = \_root.attachMovie(“enemy”, “enemy”+\_root.bullet, \_root.bullet++);  
}

as you no bullet has been renamed to bullet+number

i now need to have an enemy hittest that checks to see if it has hit the bullet.

how can i do that.

Thanks,  
stupidsaint
