# Almost eval()

**URL:** <https://forum.kirupa.com/t/almost-eval/246637>\
**Category:** Uncategorized\
**Created:** [December 12, 2007, 11:56pm UTC](https://forum.kirupa.com/t/almost-eval/246637 "2007-12-12T23:56:08Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![patrickjv](https://avatars.discourse-cdn.com/v4/letter/p/ce7236/32.png) [@patrickjv](https://forum.kirupa.com/u/patrickjv)\
**Post date:** [December 12, 2007, 11:56pm UTC](https://forum.kirupa.com/t/almost-eval/246637/1 "2007-12-12T23:56:08Z")

</div>

Been trying once again to achieve a AS2 eval() equivalent.

- I have a variable in main timeline _var test:String = “Hello World”;_
- I have a MC with a user input text field for variable _effecttext_
- I put MC on main timeline and type in text input field **test**

Now if in the MC I do the action  
\*trace( parent[effecttext] ); \*  
it nicely traces _Hello World_

But if it type in input field \*\*parent.test \*\*  
and do the action  
\*trace( this[effecttext] ); \*  
I get a _undefined_ instead of _Hello World._

If it would allow the path to be typed in the text field, one basically would have the old AS2 eval() back. Seems I’m so close… Anybody any thoughts?
