# Default Xml Slideshow - Problem with MovieClips names

**URL:** <https://forum.kirupa.com/t/default-xml-slideshow-problem-with-movieclips-names/304598>\
**Category:** Uncategorized\
**Created:** [February 10, 2010, 3:57pm UTC](https://forum.kirupa.com/t/default-xml-slideshow-problem-with-movieclips-names/304598 "2010-02-10T15:57:38Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![LS05](https://avatars.discourse-cdn.com/v4/letter/l/e19b73/32.png) [@LS05](https://forum.kirupa.com/u/LS05)\
**Post date:** [February 10, 2010, 3:57pm UTC](https://forum.kirupa.com/t/default-xml-slideshow-problem-with-movieclips-names/304598/1 "2010-02-10T15:57:38Z")

</div>

ok, i’ve 3 photos putted on the same frame but on different layers.  
I load those photos with xml with this code: [LEFT][COLOR=#993300]function[/COLOR] completeListenerCOLOR=#000000[/COLOR][COLOR=#000000]{[/COLOR]  
[COLOR=#993300]var[/COLOR] myReq:URLRequest;  
[COLOR=#993300]var[/COLOR] myURL:[COLOR=#993300]String[/COLOR];  
[COLOR=#993300]var[/COLOR] img\_path:[COLOR=#993300]String[/COLOR];  
[COLOR=#993300]var[/COLOR] [COLOR=#993300]array[/COLOR]:Array = [COLOR=#993300]new[/COLOR] [COLOR=#993300]Array[/COLOR]COLOR=#000000[/COLOR];  
myXML = [COLOR=#993300]new[/COLOR] [COLOR=#993300]XML[/COLOR]COLOR=#000000[/COLOR];  
[COLOR=#993300]var[/COLOR] loadimg:Loader;

```
[COLOR=#993300]for[/COLOR][COLOR=#000000]([/COLOR][COLOR=#993300]var[/COLOR] i:[COLOR=#993300]int[/COLOR] = [COLOR=#000000]0[/COLOR]; i &lt; [COLOR=#000000]3[/COLOR]; i++[COLOR=#000000])[/COLOR][COLOR=#000000]{[/COLOR]         
    xmlList = myXML.[COLOR=#000000]children[/COLOR][COLOR=#000000]([/COLOR][COLOR=#000000])[/COLOR][COLOR=#000000][[/COLOR]i[COLOR=#000000]][/COLOR].[COLOR=#000000]attribute[/COLOR][COLOR=#000000]([/COLOR][COLOR=#0000FF]"src"[/COLOR][COLOR=#000000])[/COLOR].[COLOR=#000000]toXMLString[/COLOR][COLOR=#000000]([/COLOR][COLOR=#000000])[/COLOR];
    [COLOR=#993300]array[/COLOR][COLOR=#000000][[/COLOR]i[COLOR=#000000]][/COLOR] = xmlList;
    [COLOR=#993300]trace[/COLOR][COLOR=#000000]([/COLOR][COLOR=#0000FF]"Array: "[/COLOR] + [COLOR=#993300]array[/COLOR][COLOR=#000000][[/COLOR]i[COLOR=#000000]][/COLOR] + [COLOR=#0000FF]"[COLOR=#000099]**

```

\*\*[/COLOR]"[/COLOR][COLOR=#000000])[/COLOR];  
[COLOR=#000000]}[/COLOR]  
[/LEFT]

\*\* loadimg = new Loader();  
loadimg.load(new URLRequest(array[0]));  
foto2.addChild(loadimg);  
loadimg.x = loadimg.width - foto2.width;  
loadimg.y = loadimg.height - foto2.height;

```
loadimg = new Loader();
loadimg.load(new URLRequest(array[1]));
foto3.addChild(loadimg);
loadimg.x = loadimg.width - foto3.width;
loadimg.y = loadimg.height - foto3.height;

loadimg = new Loader();
loadimg.load(new URLRequest(array[2]));
foto1.addChild(loadimg);
loadimg.x = loadimg.width - foto1.width;
loadimg.y = loadimg.height - foto1.height;

```

}\*\*

How can i automate the bold code?. The movieclips are on the stage yet.  
I’ve tried width this but it’s not correct.

Anyone? :cool:  
Code:

for(i = 1; i \< 4; i++)  
{  
str = “foto” + i;  
trace(str);  
loadimg = new Loader();  
loadimg.load(new URLRequest(array\*));  
str.addChild(loadimg);  
loadimg.x = loadimg.width - str.width;  
loadimg.y = loadimg.height - str.height;  
}
