# Hittest between two objects

**URL:** <https://forum.kirupa.com/t/hittest-between-two-objects/270888>\
**Category:** Uncategorized\
**Created:** [September 15, 2008, 9:09pm UTC](https://forum.kirupa.com/t/hittest-between-two-objects/270888 "2008-09-15T21:09:12Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![outlaw\_xXx](https://avatars.discourse-cdn.com/v4/letter/o/ecccb3/32.png) [@outlaw\_xXx](https://forum.kirupa.com/u/outlaw_xXx)\
**Post date:** [September 15, 2008, 9:09pm UTC](https://forum.kirupa.com/t/hittest-between-two-objects/270888/1 "2008-09-15T21:09:12Z")

</div>

hi i have a timer function that creates 2 types of objects every 2 seconds and ads them to the stage.

Next, i also have another function that has two argumets and both are objects.

I also have onEnterFrame function which is supposed to call the hitTest function to check for a hit.

The problem that i can’t seem to resolve is how do i reference the two objects in the hitTest function. Since the objects are created in another function thus not global i can’t just use their original names…

any input is appreciated, ty
