# Simple XML problem

**URL:** https://forum.kirupa.com/t/simple-xml-problem/252161
**Category:** flash
**Created:** [February 16, 2008, 11:05pm UTC](https://forum.kirupa.com/t/simple-xml-problem/252161 "2008-02-16T23:05:36Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![platinum2151](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/platinum2151/32/2857_2.png) [@platinum2151](https://forum.kirupa.com/u/platinum2151)
#### Post date: [February 16, 2008, 11:05pm UTC](https://forum.kirupa.com/t/simple-xml-problem/252161/1 "2008-02-16T23:05:36Z")

</div>

I have some very simple XML code that brings in a few images to a movie clip that is on the stage which works just fine:

\*\*info = new XML();  
info.ignoreWhite = true;  
info.load(“infoLoad.xml”);

info.onLoad = function(){   
nodes = this.firstChild;  
photo1.iconHolder.loadMovie(nodes.attributes.small1);  
photo1.imageHolder.loadMovie(nodes.attributes.large1);  
}\*\*

No problems there. But when I try to make this same code dynamically driven by the XML file, i lose everything. No images, no original movie clip, nothing. Here is the code that I have gathered from looking at some other tutorials.

\*\*info = new XML();  
info.ignoreWhite = true;  
info.load(“infoLoad.xml”);

info.onLoad = function(){   
nodes = this.firstChild;  
numOfItems = nodes.length;  
for(var i=0;i\<numOfItems;i++) {  
var element = photo1.attachMovie(“photo1”,“photo1”+i,i+1);  
element.iconHolder.loadMovie(nodes\*.attributes.small1);  
element.imageHolder.loadMovie(nodes\*.attributes.large1);  
}  
}\*\*

And here is my XML

\*\*\<copy text1=“description” small1=“icons/icon1.jpg” large1=“icons/photo1.jpg” /\>

\<copy text1=“description” small1=“icons/icon1.jpg” large1=“icons/photo1.jpg” /\>

\<copy text1=“description” small1=“icons/icon1.jpg” large1=“icons/photo1.jpg” /\*\*\>

I have looked through a ton of XML threads and keep trying little things to piece into my code, but nothing seems to work. I think (or hope) I am just missing something small. Any input would be appreciated, thanks ahead.
