# Quick question about arrays

**URL:** <https://forum.kirupa.com/t/quick-question-about-arrays/332178>\
**Category:** flash\
**Created:** [February 22, 2014, 3:26pm UTC](https://forum.kirupa.com/t/quick-question-about-arrays/332178 "2014-02-22T15:26:00Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Katira](https://avatars.discourse-cdn.com/v4/letter/k/7cd45c/32.png) [@Katira](https://forum.kirupa.com/u/Katira)\
**Post date:** [February 22, 2014, 3:26pm UTC](https://forum.kirupa.com/t/quick-question-about-arrays/332178/1 "2014-02-22T15:26:00Z")

</div>

I want to run a piece of code whenever a spesific object on stage hittests any object in an array, how can i do this?

```php
if (myObject.hitTestObject(myArray[0]))
{
 // run code
}

```

This works and executes when my object hittests the first object in the array, but how do i make it apply for any object in the array?

```php
if (myObject.hitTestObject(any object in my array))

```

sorry about the clumsy formulation but i hope you get what i am trying to do 🙂
