# Images with XML

**URL:** <https://forum.kirupa.com/t/images-with-xml/316704>\
**Category:** flash\
**Created:** [November 30, 2010, 10:38am UTC](https://forum.kirupa.com/t/images-with-xml/316704 "2010-11-30T10:38:14Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![trumpet](https://avatars.discourse-cdn.com/v4/letter/t/b4bc9f/32.png) [@trumpet](https://forum.kirupa.com/u/trumpet)\
**Post date:** [November 30, 2010, 10:38am UTC](https://forum.kirupa.com/t/images-with-xml/316704/1 "2010-11-30T10:38:14Z")

</div>

Hi,

I have the following XML ( I know I am wrong)

[XML]  
\<title\> [http://www.somedomain.com/somepic.jpg](http://www.somedomain.com/somepic.jpg) \</title\>  
\<attribute\>1\</attribute\>  
\<title\> [http://www.somedomain.com/somepic.jpg](http://www.somedomain.com/somepic.jpg) \</title\>  
\<attribute\>2\</attribute\>  
\<title\> [http://www.somedomain.com/somepic.jpg](http://www.somedomain.com/somepic.jpg) \</title\>  
\<attribute\>3\</attribute\>  
\<title\> [http://www.somedomain.com/somepic.jpg](http://www.somedomain.com/somepic.jpg) \</title\>  
\<attribute\>4\</attribute\>  
\<title\> [http://www.somedomain.com/somepic.jpg](http://www.somedomain.com/somepic.jpg) \</title\>\<attribute\>5\</attribute\>  
[/XML]

My idea is to have a flash banner that rotates automatically within these 5 options. On the Flash side, I am using a Loader component with the following code…

```auto

var webloadString:String;
var myxml=new XML();
myxml.ignoreWhite= true;
myxml.onLoad = function(success)
{
if(success)
    {
        var texttoload=myxml.firstChild.firstChild;
        trace(texttoload);
-- I need the for loop to go through each of the titles and extract the URL
-- and pass that to the Loader component to load the image.        
    }
}
myxml.load("data.xml");

Please help. The attribute section is to give that image a category.
```
