# \[CS4, AS2\] eval() problems!

**URL:** <https://forum.kirupa.com/t/cs4-as2-eval-problems/292994>\
**Category:** Uncategorized\
**Created:** [July 21, 2009, 8:35pm UTC](https://forum.kirupa.com/t/cs4-as2-eval-problems/292994 "2009-07-21T20:35:01Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Spaltzer](https://avatars.discourse-cdn.com/v4/letter/s/22d042/32.png) [@Spaltzer](https://forum.kirupa.com/u/Spaltzer)\
**Post date:** [July 21, 2009, 8:35pm UTC](https://forum.kirupa.com/t/cs4-as2-eval-problems/292994/1 "2009-07-21T20:35:01Z")

</div>

Hey Guys,

I’m not exactly the best programmer, so go easy 😛 I’m trying to hold the reference to a Movieclip (on the main timeline) on a variable inside another Movieclip. Base is the instance name of the Movieclip that holds the variable called Target. Target holds the reference to a Movieclip (Dot1, Dot2, etc.).

If I call trace(eval(Base.Target).\_x); on the main timeline, it returns the X value fine. However, if I trace (eval(Target).\_x) or trace (eval(“Target”).\_x) inside the Base MC, it returns undefined. If I trace (eval(“Target”)) inside the Base MC, it returns fine. What am I doing wrong?

The line of code is  
Closest = \_root.GetDistance(\_x, \_y, eval(“Target”).\_x, eval(“Target”).\_y);

Target is a string variable that holds the instance name of the Movieclip.

Thanks!
