# Returned value help

**URL:** <https://forum.kirupa.com/t/returned-value-help/318839>\
**Category:** Uncategorized\
**Created:** [February 1, 2011, 3:47am UTC](https://forum.kirupa.com/t/returned-value-help/318839 "2011-02-01T03:47:24Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![tristessa](https://avatars.discourse-cdn.com/v4/letter/t/a88e4f/32.png) [@tristessa](https://forum.kirupa.com/u/tristessa)\
**Post date:** [February 1, 2011, 3:47am UTC](https://forum.kirupa.com/t/returned-value-help/318839/1 "2011-02-01T03:47:24Z")

</div>

Greetings  
I’ll try & explain as briefly as i can.  
at the baselevel of my project, I am returning a XMLList  
which looks like this…

```auto

<continent id="europe">
  <location id="balen" activity="3"/>
  <location id="overpelt" activity="18"/>
  <location id="budel" activity="13"/>
  <location id="london" activity="5"/>
  <location id="zurich" activity="7"/>
  <location id="essen" activity="13"/>
  <location id="auby" activity="9"/>
</continent>

```

the returned name for this is \_LocationList;

Originally I’ve used this object as a tester in order to get my other code working, as I was waiting on the developer’s xml from the database.

```auto

EUROPE:Object = [
{name:balen,ACT:Math.random()*2},
{name:overpelt,ACT:Math.random()*20},
{name:budel,ACT:Math.random()*20},
{name:londen,ACT:Math.random()*20},
{name:zurich,ACT:Math.random()*20},
{name:essen,ACT:Math.random()*20},
{name:auby,ACT:Math.random()*20}
];

```

I am using a for loop based on above’s XMLList in order to get the xml to an object.  
But I wonder how I can re-reacte the exact Object as in EUROPE.  
the next code, succesfully adds -only- the last item of the for loop to the object.  
I can clearly trace out it’s auby in my other function that needs this object.  
I am positive to be overlooking something silly here. but I just can’t seem to resolve this on my own. Many thanks for the light !

```auto

var EUROPE:Object = []
function parseLOCATIONDATA(_LocationList):Object
{
	var NN = _LocationList.location
	trace ("parsing in europe = " + NN.length()); // 7 is correct
	for (var P:uint = 0;P<NN.length();P++)
	{
		trace (" name = " + NN[P].@id + " act " + NN[P].@activity);
                //traces out each item...
		
		EUROPE = {name: NN[P].@id , ACT: NN[P].@activity}; 
		trace ("EUROPE = " + EUROPE.name);
                //only adds the last item to the object aka :auby ...
	}
	return EUROPE;		
}

```

I tried to use push() but it gives errors.  
Thank you for saving me a few hours of “euuhm’s & curses”
