# Object Array: Variable issue

**URL:** <https://forum.kirupa.com/t/object-array-variable-issue/256214>\
**Category:** flash\
**Created:** [March 31, 2008, 10:49pm UTC](https://forum.kirupa.com/t/object-array-variable-issue/256214 "2008-03-31T22:49:21Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![EthanG800cc](https://avatars.discourse-cdn.com/v4/letter/e/97f17d/32.png) [@EthanG800cc](https://forum.kirupa.com/u/EthanG800cc)\
**Post date:** [March 31, 2008, 10:49pm UTC](https://forum.kirupa.com/t/object-array-variable-issue/256214/1 "2008-03-31T22:49:21Z")

</div>

Hello, Here is the issue at hand; I have an Object Array, and would like to set one of the items to be a variable outside of the array. As of now, it just references the variable as existing only in the array.

```auto
 var outColor:uint; var colorArray:Array = new Array({colorName: &quot;out-color&quot;, colorVar: outColor}); colorArray[0].colorVar = parseInt(&quot;FF0000&quot;, 16); trace(colorArray[0].colorVar); //outputs 16711680 trace(outColor); // outputs 0 

```

So, as we can see, the variable is changing in the array, but not the external variable, which I need it to do, so that I can reference that later without iterating through my array. I have read about this before, but have since forgotten what to do. After searching for a while now, I am coming up dry. I believe it is something like:

```auto
 var colorArray:Array = new Array({colorName: &quot;out-color&quot;, colorVar: [outColor]}); 

```

```
Or something like that, where I have to encapsulate the variable in syntax that describes it as an external variable. Please let me know if I'm making any sense, lol. Thanks, -EthanG
```
