# Help on 2 XMLLists

**URL:** <https://forum.kirupa.com/t/help-on-2-xmllists/298592>\
**Category:** flash\
**Created:** [October 21, 2009, 5:07pm UTC](https://forum.kirupa.com/t/help-on-2-xmllists/298592 "2009-10-21T17:07:12Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![spmc](https://avatars.discourse-cdn.com/v4/letter/s/fbc32d/32.png) [@spmc](https://forum.kirupa.com/u/spmc)\
**Post date:** [October 21, 2009, 5:07pm UTC](https://forum.kirupa.com/t/help-on-2-xmllists/298592/1 "2009-10-21T17:07:12Z")

</div>

Long set-up, sorry…

I’ve got my xml loading and I’m splitting it into two XMLLists based on an attribute. The problem I’m having is correctly setting up functions for each list to loop through and set up the correct buttons and content.

What type of loop would be best suited to do this? Where it executes based on the new xmllist name or something.

Any suggestions would be greatly appreciated.

```auto

var season1XML:XMLList = xmlData.section.(hasOwnProperty("@season") && @season == "1");
//trace(season1XML.toXMLString()); - THAT TRACES CORRECTLY

var season2XML:XMLList = xmlData.section.(hasOwnProperty("@season") && @season == "2");
//trace(season2XML.toXMLString()); - and THAT TRACES CORRECTLY

```

So again, after I have these two new lists, whats the best way to loop through them. (When I only had one list I was using a while (i–). But now that there are two that’s not working…

Thanks
