# Convert string to class

**URL:** <https://forum.kirupa.com/t/convert-string-to-class/323701>\
**Category:** Uncategorized\
**Created:** [July 13, 2011, 4:20am UTC](https://forum.kirupa.com/t/convert-string-to-class/323701 "2011-07-13T04:20:30Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![microScript](https://avatars.discourse-cdn.com/v4/letter/m/f07891/32.png) [@microScript](https://forum.kirupa.com/u/microScript)\
**Post date:** [July 13, 2011, 4:20am UTC](https://forum.kirupa.com/t/convert-string-to-class/323701/1 "2011-07-13T04:20:30Z")

</div>

Hi guys,

I need to call the mc from the library, dynamically any some of the mc’s from library. I named that class as “mc\_1”, “mc\_2”, “mc\_3” etc. I now have the class name as a String. With that I can’t able to get the mc from the library.

my code is

```auto
var myString:String = "mc_1";
var mc:myString = new myString(); // Throws error.

```

Any help would be great.

Thanks in advance.
