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
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
var myGet = new GetTeams();
But now I need to access it from my main timeline as well.
So I tried
trace(teamCity);
// and
trace(GetTeams.teamCity);
// things like that
Thanks yall