# AS string to var name

**URL:** <https://forum.kirupa.com/t/as-string-to-var-name/284342>\
**Category:** flash\
**Created:** [March 18, 2009, 8:58am UTC](https://forum.kirupa.com/t/as-string-to-var-name/284342 "2009-03-18T08:58:08Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![dc\_duo](https://avatars.discourse-cdn.com/v4/letter/d/5e9695/32.png) [@dc\_duo](https://forum.kirupa.com/u/dc_duo)\
**Post date:** [March 18, 2009, 8:58am UTC](https://forum.kirupa.com/t/as-string-to-var-name/284342/1 "2009-03-18T08:58:08Z")

</div>

Hi guys,

Another quick question. Is there any way that you can pass a string to a function and use its value as the variable name you wish to change. For example.

```auto

var text:String = "Goodbye World";

function myfunction ( varToChange)
{
    varToChange = "Hello World";
}

myfunction("text")

```
