Hey Guys, I only started coding Actionscript about two weeks ago and I really need help on this, I am seriously considering just coding an if statement for each value if I can’t figure this out. Sorry if my code is terrible formatted, I am self taught using Adobe Help.
This is what I need help on.
I have a program installed on a game server (CoD4) that outputs the server information including player(s) info and would like to be able to make it so that there is a flash document on the website displaying the information for each player. I wanted the program to build the information automatically and so far I have been able to make it work but the formatting of the output is terrible.
To make things simple, the only real information I need from each player is their name and guid. Hopefully each player’s info is on a new line.
This is the xml document the server is outputting:
http://teamrevox.clanservers.com/status.xml
import flash.net.URLRequest;
import flash.net.URLLoader;
import flash.events.*;
var serverStatus:XML;
var statusURL:URLRequest = new URLRequest("http://teamrevox.clanservers.com/status.xml");
var statusLoader:URLLoader = new URLLoader;
statusLoader.addEventListener(Event.COMPLETE, statusXMLLoaded);
statusLoader.load(statusURL);
function statusXMLLoaded(e:Event)
{
serverStatus = new XML(e.currentTarget.data);
var getClients:Number = serverStatus.Clients.@Total;
var getClientNum:Array = new Array(serverStatus.Clients.Client.@CID);
if (getClients>=1)
{
for each(var value:* in getClientNum) {
var playerStats:Object = new Object();
playerStats.Name = serverStatus.Clients.Client.@Name;
playerStats.Score = serverStatus.Clients.Client.@Score;
playerStats.GUID = serverStatus.Clients.Client.@GUID;
playerStats.Team = serverStatus.Clients.Client.@Team;
for each(var value:* in playerStats) {
trace(value);
}
}
}
}
Current output
100
2724a018280a650780ae32850b577ace77bc80ec407a5fbb514eaf8671af554b
rVx//ser1ousreVox.Phonix
32
Any help would be AWESOME!