# Trouble with for loop and xml

**URL:** <https://forum.kirupa.com/t/trouble-with-for-loop-and-xml/257367>\
**Category:** Uncategorized\
**Created:** [April 13, 2008, 11:37am UTC](https://forum.kirupa.com/t/trouble-with-for-loop-and-xml/257367 "2008-04-13T11:37:49Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ecptavares](https://avatars.discourse-cdn.com/v4/letter/e/9d8465/32.png) [@ecptavares](https://forum.kirupa.com/u/ecptavares)\
**Post date:** [April 13, 2008, 11:37am UTC](https://forum.kirupa.com/t/trouble-with-for-loop-and-xml/257367/1 "2008-04-13T11:37:49Z")

</div>

Hi!

I have this code that I insert every item in a XML file into an array.

```auto

		private function onXMLLoaded(event:Event):void
		{
			xmlPic = new XML(xmlLoader.data);
			
			for (var i:uint = 0;i < 5;i++)
			{
				thumbs.push(xmlPic.pic*.@url);
			}
			
			loadThumbs();			
		}

```

I know that I have 5 items(I am just testing). If I change 5 for xmlPIC.length it wont show me anything. If I leave 5 on the for loop I have the results I want.

What is wrong?
