# String to MovieClip?

**URL:** https://forum.kirupa.com/t/string-to-movieclip/254375
**Category:** flash
**Created:** [March 11, 2008, 1:53pm UTC](https://forum.kirupa.com/t/string-to-movieclip/254375 "2008-03-11T13:53:06Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![sceneshift](https://avatars.discourse-cdn.com/v4/letter/s/5daacb/32.png) [@sceneshift](https://forum.kirupa.com/u/sceneshift)
#### Post date: [March 11, 2008, 1:53pm UTC](https://forum.kirupa.com/t/string-to-movieclip/254375/1 "2008-03-11T13:53:06Z")

</div>

I have some MovieClips in my library, each with a class name and exported for actionscript. What I want to do is add the movieclips to my stage by having the user click on a relevant button. To keep things simple, I have named each individual button after the movieclip I want to load… but obviously, the ‘e.target.name’ is a string.

So when I call my function createItem(e.target.name)… I need a want to turn that string into a reference for my movieclip class

Can anyone tell me how this is done?

---

<div class="post-metadata">

### Author: ![ad0ac](https://avatars.discourse-cdn.com/v4/letter/a/e9bcb4/32.png) [@ad0ac](https://forum.kirupa.com/u/ad0ac)
#### Post date: [May 13, 2008, 12:01am UTC](https://forum.kirupa.com/t/string-to-movieclip/254375/2 "2008-05-13T00:01:48Z")

</div>

seconded - that saved me a few hours! thanks.
