# How can i get a property from a string?

**URL:** <https://forum.kirupa.com/t/how-can-i-get-a-property-from-a-string/305574>\
**Category:** Uncategorized\
**Created:** [February 27, 2010, 5:06pm UTC](https://forum.kirupa.com/t/how-can-i-get-a-property-from-a-string/305574 "2010-02-27T17:06:46Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![cakepizza](https://avatars.discourse-cdn.com/v4/letter/c/45deac/32.png) [@cakepizza](https://forum.kirupa.com/u/cakepizza)\
**Post date:** [February 27, 2010, 5:06pm UTC](https://forum.kirupa.com/t/how-can-i-get-a-property-from-a-string/305574/1 "2010-02-27T17:06:46Z")

</div>

does anyone know a way to use a string to to retrieve the property with that name?  
something like…

```auto

var myString:String ="myVarInMovieClip";
var myString2:String ="x";

//trace the value of variable myVarInMovieClip, and the x coordinate.
trace(myMovieClip.toProperty(myString));
trace(myMovieClip.toProperty(myString2));

```
