# Access attribute values via variable name

**URL:** <https://forum.kirupa.com/t/access-attribute-values-via-variable-name/280928>\
**Category:** flash\
**Created:** [February 3, 2009, 2:38am UTC](https://forum.kirupa.com/t/access-attribute-values-via-variable-name/280928 "2009-02-03T02:38:35Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![j1mb0](https://avatars.discourse-cdn.com/v4/letter/j/22d042/32.png) [@j1mb0](https://forum.kirupa.com/u/j1mb0)\
**Post date:** [February 3, 2009, 2:38am UTC](https://forum.kirupa.com/t/access-attribute-values-via-variable-name/280928/1 "2009-02-03T02:38:35Z")

</div>

Hi,

I have a flex app where I need to be able to access and modify component attributes using variable names.

eg, say I want to edit the text attributes of text label.

I am not sure what object or attribute will need to be updated until runtime.

Say I get passed the following variables:

```
var objId:String = "label1";
var objAtt:String = "text";
var objVal:String = "Hello World";

```

I need to take these and update the “text” property of label that has the ID “label1” to “Hello World”.

I have tried different variations to accomplish this but am stuck  
One example is

```
this[objId][objAtt] = objVal;

```

Am I missing something obvious?
