# Eval replacement?

**URL:** <https://forum.kirupa.com/t/eval-replacement/320389>\
**Category:** flash\
**Created:** [March 22, 2011, 12:29pm UTC](https://forum.kirupa.com/t/eval-replacement/320389 "2011-03-22T12:29:18Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![geter712](https://avatars.discourse-cdn.com/v4/letter/g/9d8465/32.png) [@geter712](https://forum.kirupa.com/u/geter712)\
**Post date:** [March 22, 2011, 12:29pm UTC](https://forum.kirupa.com/t/eval-replacement/320389/1 "2011-03-22T12:29:18Z")

</div>

Ok, I know there is no eval function in AS3, and that [‘bla’+bla] is a proper replacement, when it comes to calling dynamically created objects, but this what I need is a little bit different… I have a piece of AS3 code, that I need to execute from a string. If eval was alive, it would do it like this:

```auto
var myAsCode:String = 'var myClip:MovieClip = new MovieClip();myClip.name='myClip';trace(myClip.name)';
eval(myAsCode);

```

Any solutions?

PS: I was already considering parser solution, but it isn’t an option, since code might be very complicated…
