# XML and List component

**URL:** <https://forum.kirupa.com/t/xml-and-list-component/282956>\
**Category:** flash\
**Created:** [February 28, 2009, 8:01am UTC](https://forum.kirupa.com/t/xml-and-list-component/282956 "2009-02-28T08:01:01Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![bgflasher](https://avatars.discourse-cdn.com/v4/letter/b/d6d6ee/32.png) [@bgflasher](https://forum.kirupa.com/u/bgflasher)\
**Post date:** [February 28, 2009, 8:01am UTC](https://forum.kirupa.com/t/xml-and-list-component/282956/1 "2009-02-28T08:01:01Z")

</div>

Hello to all!  
That’s my first post here and I am happy to be part of kirupa flash community.  
Well. I’ll tell you about my problem.  
I am developing a flash audio player that streams audio(radio stations) from a flash media server. It is XML driven and it’s working. I use the list component and for ‘label’ i put the radio station name with ‘name’ attribute and for ‘data’ i put the ‘url’ attribute:  
\<station disp = “someRadio FM” url = “[http://someRadiourl](http://someRadiourl)”\>  
So I am making a loop through the XML tags to load them into the list component’s items.  
Everything’s fine. But I must add a ‘server’ tag to the XML list so the flash media server url is not hardcoded in the flash file. And you know i can’t have more than one ‘data’ for an item in the list component.  
My code goes that way:

```auto
for each(var stItem:XML in xml.station){
        item = new Object();
        item.label = stItem.@disp.toString();
        item.data = stItem.@url.toString();
        serverUrl = stItem.server.@url.toString();
        playList.addItem(item);
}

```

But now i cannot use ‘serverUrl’ outside the loop. My question is: how can i associate the ‘serverUrl’ tag with the selectedItem?
