# Get Return from Class

**URL:** <https://forum.kirupa.com/t/get-return-from-class/259690>\
**Category:** flash\
**Created:** [May 7, 2008, 8:35pm UTC](https://forum.kirupa.com/t/get-return-from-class/259690 "2008-05-07T20:35:06Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Digitalosophy](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/digitalosophy/32/1114_2.png) [@Digitalosophy](https://forum.kirupa.com/u/Digitalosophy)\
**Post date:** [May 7, 2008, 8:35pm UTC](https://forum.kirupa.com/t/get-return-from-class/259690/1 "2008-05-07T20:35:06Z")

</div>

N00bish question here forgive me.

I created a class that returns and array. How can I access that return from my main timeline?

I just need to trace the return in this case.

GetTeams.as

```auto

class GetTeams {
    public function GetTeams () {
        var teamLoaderURL:String = "teams.jsp";
        var teamCity:Array = new Array ();
        var teamName:Array = new Array ();
        var teamCode:Array = new Array ();
        function loadXML (loaded:Boolean) {
            if (loaded) {
                var xmlNode:XML = this.firstChild;
                for (var i:Number = 0; i < 30; i++) {
                    teamCity* = xmlNode.childNodes[0].childNodes*.attributes.city;
                    teamName* = xmlNode.childNodes[0].childNodes*.attributes.name;
                    teamCode* = xmlNode.childNodes[0].childNodes*.attributes.teamcode;
                }
            }
            return teamCity;
        }
        var xmlData:Object = new XML ();
        xmlData.ignoreWhite = true;
        xmlData.onLoad = loadXML;
        xmlData.load (teamLoaderURL);
    }
}

```

On my main timeline I have

```auto

var myGet = new GetTeams();

```

But now I need to access it from my main timeline as well.

So I tried

```auto

trace(teamCity);
// and
trace(GetTeams.teamCity);
// things like that

```

Thanks yall

---

<div class="post-metadata">

**Author:** ![Digitalosophy](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/digitalosophy/32/1114_2.png) [@Digitalosophy](https://forum.kirupa.com/u/Digitalosophy)\
**Post date:** [May 8, 2008, 5:05pm UTC](https://forum.kirupa.com/t/get-return-from-class/259690/2 "2008-05-08T17:05:14Z")

</div>

Thanks again everyone.

@onecommoncode: using your technique I was able to gather all the data I needed to display it in a data grid on my main stage (just as an example). One of our java guys is helping with me with this concept. If we have any question with the code I’ll give you a shout.

Thanks again for your time.
