# hiTest

**URL:** https://forum.kirupa.com/t/hitest/8426
**Category:** flash
**Created:** [November 21, 2002, 2:10am UTC](https://forum.kirupa.com/t/hitest/8426 "2002-11-21T02:10:22Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![BullDog\_Flash](https://avatars.discourse-cdn.com/v4/letter/b/d07c76/32.png) [@BullDog\_Flash](https://forum.kirupa.com/u/BullDog_Flash)
#### Post date: [November 21, 2002, 2:10am UTC](https://forum.kirupa.com/t/hitest/8426/1 "2002-11-21T02:10:22Z")

</div>

Hey everBody

Hows it going.  
Well not so well for me…  
Im gettin pi\*\*\*\*\* off that i cant get this

hitTest working ill give you the code

```auto
 onClipEvent (load) {
    speed = 10;
    _x = random(380)+150;
    _y = 0;
}
onClipEvent (enterFrame) {
    this._y += speed;
    if (_y == 450) {
        _root.ballon.removeMovieClip();
        this.duplicateMovieClip("ballon"+c, c);
        c++;
        if (hitTest(_root.hero)) {
            gotoAndStop(2);
        }
    }
}
{

```

And i have a guy that has the instance with hero and a guy that walks but this little code wont work can you think of a way for me plz ppl

---

<div class="post-metadata">

### Author: ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)
#### Post date: [November 21, 2002, 11:37am UTC](https://forum.kirupa.com/t/hitest/8426/2 "2002-11-21T11:37:44Z")

</div>

Hi,

I would push the duplications into an array and then hitTest the the hero against the contents of the array in a ‘for’ loop.

I think a good rule to follow is:  
**creation of elements :** duplication your case.  
**sstoring of elements :** push the created elements into an array  
**access to elements :** for loop.

Cheers

SHO
