# Problem duplicating and positioning movieclips loaded from an xml

**URL:** <https://forum.kirupa.com/t/problem-duplicating-and-positioning-movieclips-loaded-from-an-xml/135094>\
**Category:** Uncategorized\
**Created:** [January 24, 2005, 7:01pm UTC](https://forum.kirupa.com/t/problem-duplicating-and-positioning-movieclips-loaded-from-an-xml/135094 "2005-01-24T19:01:51Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![azionescript](https://avatars.discourse-cdn.com/v4/letter/a/ecae2f/32.png) [@azionescript](https://forum.kirupa.com/u/azionescript)\
**Post date:** [January 24, 2005, 7:01pm UTC](https://forum.kirupa.com/t/problem-duplicating-and-positioning-movieclips-loaded-from-an-xml/135094/1 "2005-01-24T19:01:51Z")

</div>

Ciao a tutti  
I’m working with a script that loads from an XML some jpgs, these ones once loaded move to their positions.

Info = [color=#000084]new[/color] [color=#000084]XML/color;Info.[color=#000084]ignoreWhite[/color] = [color=#000084]true[/color];Info.[color=#000084]onLoad[/color] = [color=#000084]function/color { picture = [color=#000084]this[/color].firstChild; count = picture.childNodes.[color=#000084]length[/color]; [color=#000084]for[/color] (child=0; child\<count; child++) { currentPicture = picture.childNodes[child]; currentThumb = item\_1.[color=#000084]duplicateMovieClip[/color]("[color=#0000ff]thumbnail[/color]"+child, child); currentThumb.[color=#000084]\_xscale[/color] = 15; currentThumb.[color=#000084]\_yscale[/color] = 15; currentThumb.[color=#000084]\_alpha[/color] = 1; [color=#000084]\_root[/color].currentThumb.xDest = child_50; [color=#000084]\_root[/color].currentThumb.yDest = child_1; image = currentThumb.[color=#000084]createEmptyMovieClip[/color]("[color=#0000ff]thumbnail\_image[/color]", 0); image.[color=#000084]loadMovie/color; }};Info.[color=#000084]load/color;  
the problem is that i would like put all these movies well aligned in rows and columns, i’ve seen it’s possible to do this with a nested for… loop, something like this

[color=#000084]for[/color](y = 1; y \<= 4; y++){ [color=#000084]for[/color] (x = 1; x \<= 9; x++){ depth++; [color=#000084]_root[/color].item\_1.[color=#000084]duplicateMovieClip[/color]("[color=#0000ff]item_[/color]" [color=#000084]add[/color] x [color=#000084]add[/color] “[color=#0000ff]_[/color]" [color=#000084]add[/color] y, depth+2); [color=#000084]root[/color]["[color=#0000ff]item[/color]" [color=#000084]add[/color] x [color=#000084]add[/color] "[color=#0000ff]_[/color]” [color=#000084]add[/color] y].[color=#000084]\_x[/color] = [color=#000084]\_root[/color].item\_1.[color=#000084]_x[/color] + (50 \* (x-1)); [color=#000084]root[/color]["[color=#0000ff]item[/color]" [color=#000084]add[/color] x [color=#000084]add[/color] "[color=#0000ff]_[/color]" [color=#000084]add[/color] y].[color=#000084]\_y[/color] = [color=#000084]\_root[/color].item\_1.[color=#000084]\_y[/color] + (50 \* (y-1)); }}but don’t know how combine the two scripts  
thanks in advance
