# Duplicate movieclip

**URL:** <https://forum.kirupa.com/t/duplicate-movieclip/32288>\
**Category:** Uncategorized\
**Created:** [October 4, 2003, 7:58am UTC](https://forum.kirupa.com/t/duplicate-movieclip/32288 "2003-10-04T07:58:59Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![xzyfer](https://avatars.discourse-cdn.com/v4/letter/x/ce73a5/32.png) [@xzyfer](https://forum.kirupa.com/u/xzyfer)\
**Post date:** [October 4, 2003, 7:58am UTC](https://forum.kirupa.com/t/duplicate-movieclip/32288/1 "2003-10-04T07:58:59Z")

</div>

i have a sqaure movieclip…

name: blockBefore  
instance: BLOCKbefore  
size: 20x20

my canvas is 400px wide…  
im tryin to duplicate BLOCKbefore 20times along the top of my canvas…  
i have the first one at 0,0 (top left corner)…  
i want to know y this code dose not work…  
if anybosy knows…

[AS]onClipEvent (load) {  
amount = 20;  
while(amount\>0){  
duplicateMovieClip(BLOCKbefore, “BLOCKbefore”+i,i);  
**\_root.BLOCKbefore+i.\_x** = \_root.BLOCKbefore+(x-1).\_x + 10;  
i=i+1;  
amount=amount-1;  
}  
}[/AS]  
i keep getting an error here any ideas of wats wrong with this code… or of a better way to do it would be really hopeful…
