If I m understanding well, you shuld try to replace playerID by currID in your XML receiver object because atm you put the xml reply in a playerID
var and the line after you call saveGame
with currID
as arg which is undefined.
function scoreboardSubmit() {
var insertReceive:XML = new XML();
insertReceive.ignoreWhite = true;
insertReceive.onLoad = function() {
var currID = this.firstChild.childNodes[0];
saveGame(currID);
};
insertSend = new LoadVars();
insertSend.playername = playername;
insertSend.playerscore = playerscore;
insertSend.playerID = playerID;
insertSend.sendAndLoad("scoreboardSend.php", insertReceive, "POST");
}
You should add the correct content type to your php page
header('Content-type: text/xml');
Finally I think it would be better to store your data in a different way (for exemple by using a savedgame object which contains all game related properties for a same currID)