# Very Hard! Need to dupe, and autoname mc's, based on a var

**URL:** <https://forum.kirupa.com/t/very-hard-need-to-dupe-and-autoname-mcs-based-on-a-var/1725>\
**Category:** Uncategorized\
**Created:** [June 4, 2002, 6:21pm UTC](https://forum.kirupa.com/t/very-hard-need-to-dupe-and-autoname-mcs-based-on-a-var/1725 "2002-06-04T18:21:03Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [June 4, 2002, 6:21pm UTC](https://forum.kirupa.com/t/very-hard-need-to-dupe-and-autoname-mcs-based-on-a-var/1725/1 "2002-06-04T18:21:03Z")

</div>

I’m using 1 function to do all this, so yes it has to be this complex. : )

My clip to dupe: \_root.matchjobs.matchj  
must be duplicated as: \_root.matchjobs[matchj + f] where f is an incrementing value. (matchj0, matchj1, etc.)

However, since i receive the locations matchjobs and matchj as variables, it becomes:  
\_root[firstvar][secondvar].duplicateMovieClip(\_root[firstvar][secondvar], depth);

This is all being run from \_level0 and I can’t get the clips to duplicate properly. They just… don’t… dupe…

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [June 4, 2002, 6:27pm UTC](https://forum.kirupa.com/t/very-hard-need-to-dupe-and-autoname-mcs-based-on-a-var/1725/2 "2002-06-04T18:27:22Z")

</div>

Have you tried using eval? like eval("\_root[" + firstVar + “][” + secondVar + “]”).duplicateMovieClip(eval("\_root[" + firstVar + “][” + secondVar + “]”), depth);

not sure if that will work or not, but eval works for me when i can’t get variables to resolve to their values.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [June 5, 2002, 1:07pm UTC](https://forum.kirupa.com/t/very-hard-need-to-dupe-and-autoname-mcs-based-on-a-var/1725/3 "2002-06-05T13:07:29Z")

</div>

Thanks. I never did get the duplications to work using eval. To be honest, I’m not sure why they started working, but I’m beyond caring at this point.

Thanks for the assist!
