# \[Flash8\] Loading XML...Help needed!

**URL:** <https://forum.kirupa.com/t/flash8-loading-xml-help-needed/213076>\
**Category:** flash\
**Created:** [January 16, 2007, 8:18pm UTC](https://forum.kirupa.com/t/flash8-loading-xml-help-needed/213076 "2007-01-16T20:18:43Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![hmig](https://avatars.discourse-cdn.com/v4/letter/h/50afbb/32.png) [@hmig](https://forum.kirupa.com/u/hmig)\
**Post date:** [January 16, 2007, 8:18pm UTC](https://forum.kirupa.com/t/flash8-loading-xml-help-needed/213076/1 "2007-01-16T20:18:43Z")

</div>

Hello. I have an xml doc that I am loading into flash. One problem is that I need these two items medDesc and medname to load all info in these areas. Right now, it only loads the zero value (or which ever specific number you put in brackets)…meanwhile, there are up to 7 items that could be here.

Does anyone know how to load all the values…Randomly, if possible.

```auto
import mx.utils.Delegate;
var chemomeds:Array;
var xml:XML = new XML();
function onXmlLoaded(success:Boolean) {
 if (success) {
  var mainnode:XMLNode = xml.firstChild;
  var chemomedsnodes:Array = xml.firstChild.childNodes;
  for (var i:Number = 0; i<chemomedsnodes.length; i++) {
      var categorynode:XMLNode = chemomedsnodes*;
   chemomeds.push({i:i+1,cname:categorynode.attributes.name,
   **medDesc:categorynode.childNodes[0].firstChild,**
**medname:categorynode.childNodes[0].attributes.name**});
  }
  setup();
  } else {
  trace('error reading XML');
 }
}

```

Thanks!
