# Better Way to Reference One of Many Objects

**URL:** <https://forum.kirupa.com/t/better-way-to-reference-one-of-many-objects/309694>\
**Category:** flash\
**Created:** [May 21, 2010, 5:09pm UTC](https://forum.kirupa.com/t/better-way-to-reference-one-of-many-objects/309694 "2010-05-21T17:09:12Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Stubbs](https://avatars.discourse-cdn.com/v4/letter/s/2acd7d/32.png) [@Stubbs](https://forum.kirupa.com/u/Stubbs)\
**Post date:** [May 21, 2010, 5:09pm UTC](https://forum.kirupa.com/t/better-way-to-reference-one-of-many-objects/309694/1 "2010-05-21T17:09:12Z")

</div>

How do you guys reference one of multiple objects? Every recent project of mine winds up having a bunch of items pushed into an array, and I find out which one to manipulate like this:

```auto

function myFunction():void
{
   index = e.target.name.slice(5,7); // object is named "item_1"
   myArray[index].x += 5 (or whatever);
}

```

Is there an “ideal” (or better) way to do this? I hope this makes sense.
