# \[Flash8\] Need help duplicating instances

**URL:** <https://forum.kirupa.com/t/flash8-need-help-duplicating-instances/195597>\
**Category:** flash\
**Created:** [August 1, 2006, 8:33pm UTC](https://forum.kirupa.com/t/flash8-need-help-duplicating-instances/195597 "2006-08-01T20:33:39Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![pavers355](https://avatars.discourse-cdn.com/v4/letter/p/e56c9b/32.png) [@pavers355](https://forum.kirupa.com/u/pavers355)\
**Post date:** [August 1, 2006, 8:33pm UTC](https://forum.kirupa.com/t/flash8-need-help-duplicating-instances/195597/1 "2006-08-01T20:33:39Z")

</div>

I am writing a maze program for school. I am using a 2d array to represent to location of walls for the maze. The background (for figuring out where a player can move) is not the problem.

I am using this algorithm for places the images…

for (i = 0; i \< 22; i++) {[INDENT]for (j = 0; j \< 16; j++) {[INDENT]if (maze\*[j] == 1) {[INDENT]instanceName = “wall” add i add j; //for multiple names for each instance  
duplicateMovieClip(“wall”, newname = “instanceName”, 1);  
setProperty(“instanceName”, \_x, (25_i+13));  
setProperty(“instanceName”, \_y, (25_j+13));

[/INDENT]}

[/INDENT]}

[/INDENT]}

What needs to be done to use many copies of one instance to build the visible part of my maze? I want to be able to have all pieces anmed “wall” instead of “wall1”, “wall2”, etc…which isn’t working anyway.

Please respond!
