# Grouping Similar Items in AS2

**URL:** <https://forum.kirupa.com/t/grouping-similar-items-in-as2/195919>\
**Category:** flash\
**Created:** [August 4, 2006, 12:25am UTC](https://forum.kirupa.com/t/grouping-similar-items-in-as2/195919 "2006-08-04T00:25:37Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pepin](https://avatars.discourse-cdn.com/v4/letter/p/ecccb3/32.png) [@Pepin](https://forum.kirupa.com/u/Pepin)\
**Post date:** [August 4, 2006, 12:25am UTC](https://forum.kirupa.com/t/grouping-similar-items-in-as2/195919/1 "2006-08-04T00:25:37Z")

</div>

Alright this may be a stupid question but I could use the answer. I want to be able to group all my enemies into one variable. So I could say

if (this.hitTest(enemys)) {  
enemyhealth -= 1  
}

instead of having to type the script out for each enemy.

I think I have to use an array but I not sure. All the array tutorials didn’t seem to have what I wanted.
