# Duplicate not working like i want it to

**URL:** <https://forum.kirupa.com/t/duplicate-not-working-like-i-want-it-to/209306>\
**Category:** Uncategorized\
**Created:** [December 7, 2006, 5:11pm UTC](https://forum.kirupa.com/t/duplicate-not-working-like-i-want-it-to/209306 "2006-12-07T17:11:47Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![VoS](https://avatars.discourse-cdn.com/v4/letter/v/22d042/32.png) [@VoS](https://forum.kirupa.com/u/VoS)\
**Post date:** [December 7, 2006, 5:11pm UTC](https://forum.kirupa.com/t/duplicate-not-working-like-i-want-it-to/209306/1 "2006-12-07T17:11:47Z")

</div>

hey…  
I want to duplicate a mc as many times as there are objects in an array, and name each duplication after the value in the array’s postion i’m at…  
i then want to be able to do things to those mc’s  
my code:  
ActionScript Code:  
[FONT=Courier New][LEFT][COLOR=#0000ff]for[/COLOR] [COLOR=#000000]([/COLOR][COLOR=#000000] **var** [/COLOR] w:[COLOR=#0000ff]Number[/COLOR] = [COLOR=#000080]0[/COLOR]; w \<= widgets.[COLOR=#000080]length[/COLOR]-[COLOR=#000080]1[/COLOR]; w++[COLOR=#000000])[/COLOR] [COLOR=#000000]{[/COLOR]  
[COLOR=#0000ff]trace[/COLOR]COLOR=#000000[/COLOR];  
[COLOR=#0000ff]duplicateMovieClip[/COLOR][COLOR=#000000]([/COLOR]widg, widgets[COLOR=#000000][[/COLOR]w[COLOR=#000000]][/COLOR], [COLOR=#0000ff]this[/COLOR].[COLOR=#0000ff]getNextHighestDepth[/COLOR]COLOR=#000000[/COLOR][COLOR=#000000])[/COLOR];  
curr=[COLOR=#0000ff]eval[/COLOR]COLOR=#000000[/COLOR];  
[COLOR=#0000ff]trace[/COLOR]COLOR=#000000[/COLOR];  
curr.[COLOR=#0000ff]\_x[/COLOR]=[COLOR=#000080]10[/COLOR]+w\*[COLOR=#000080]20[/COLOR];  
curr.[COLOR=#0000ff]\_y[/COLOR]=[COLOR=#000080]10[/COLOR]+w\*[COLOR=#000080]20[/COLOR];  
[COLOR=#000000]}[/COLOR]  
[/LEFT]  
[/FONT]

## the output generated is this

## blocket \_level0.blocket test \_level0.test

the array ‘widgets’ contains two strings [blocket,test]

now later on in the .swf i try to do this…  
ActionScript Code:  
[FONT=Courier New][LEFT][COLOR=#0000FF]trace[/COLOR]COLOR=#000000[/COLOR]  
[/LEFT]  
[/FONT]

but that returns undefined why?

Thanks  
//VoS
