# Returning Object From a Function?

**URL:** https://forum.kirupa.com/t/returning-object-from-a-function/310029
**Category:** flash
**Created:** [May 30, 2010, 7:21pm UTC](https://forum.kirupa.com/t/returning-object-from-a-function/310029 "2010-05-30T19:21:43Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![as3ohh](https://avatars.discourse-cdn.com/v4/letter/a/eb9ed0/32.png) [@as3ohh](https://forum.kirupa.com/u/as3ohh)
#### Post date: [May 30, 2010, 7:21pm UTC](https://forum.kirupa.com/t/returning-object-from-a-function/310029/1 "2010-05-30T19:21:43Z")

</div>

Hey All, I am new to AS3 and need to gather data from an XML file, parse it and then return all the vars to be used globally. How do I return an object like in the code below? I may be close but keep hitting walls and could some guidance.

If you have better (easier) ways I am wide open to your expertise.

```auto
var dSession:Object = new Object();

function parseXMLData(incomingData:XML):Object
{

    dSession.pname = incomingData.ses01.pname;
    dSession.pdate = incomingData.ses01.pdate;
    dSession.pspeaker = incomingData.ses01.pspeaker;
    dSession.pposition = incomingData.ses01.pposition;
    dSession.pcompany = incomingData.ses01.pcompany;
    dSession.pvideo = incomingData.ses01.pvideo;
    
    return dSession;

}

trace(dSession.pvideo); // I'm getting no response (Like Steve Jobs)

```
