# Reference a object thru a variable

**URL:** <https://forum.kirupa.com/t/reference-a-object-thru-a-variable/306245>\
**Category:** Uncategorized\
**Created:** [March 11, 2010, 4:58pm UTC](https://forum.kirupa.com/t/reference-a-object-thru-a-variable/306245 "2010-03-11T16:58:58Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![jbitkill](https://avatars.discourse-cdn.com/v4/letter/j/85e7bf/32.png) [@jbitkill](https://forum.kirupa.com/u/jbitkill)\
**Post date:** [March 11, 2010, 4:58pm UTC](https://forum.kirupa.com/t/reference-a-object-thru-a-variable/306245/1 "2010-03-11T16:58:58Z")

</div>

Hi,

If I wanted to change the ‘x’ of a object, and a variable contained a the object’s name, how would I change the ‘x’ by using the variable.

Without variable:

```auto
myObject.x = 123;

```

With variable maybe?:

```auto
(myVar.text).x = 123;

```

Any suggestions?

Josh
