# hitTestObject - Multiple Times

**URL:** <https://forum.kirupa.com/t/hittestobject-multiple-times/309226>\
**Category:** flash\
**Created:** [May 10, 2010, 3:18pm UTC](https://forum.kirupa.com/t/hittestobject-multiple-times/309226 "2010-05-10T15:18:49Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![wwfc\_barmy\_army](https://avatars.discourse-cdn.com/v4/letter/w/d2c977/32.png) [@wwfc\_barmy\_army](https://forum.kirupa.com/u/wwfc_barmy_army)\
**Post date:** [May 10, 2010, 3:18pm UTC](https://forum.kirupa.com/t/hittestobject-multiple-times/309226/1 "2010-05-10T15:18:49Z")

</div>

Hello.

I have the following code to pick up collision detection between two objects:

```auto

public function loop(e:Event) : void
  {
     if (this.heli.hitTestObject(enemy)) {
         Clashed();
          
       }
    }

```

and

```auto

public function Clashed()
        {                        
            trace("Clash!");                
            ScoreCounter++;
            trace("score: " + ScoreCounter);

        }

```

It works but in the output (from trace) it shows it as a ‘clash’ multiple times for ‘one clash’, and score count can go up to a large number if you hang around the same area.

How can I get it so it only seems it as one ‘clash’?

thanks.
