I have a piece of code that checks to see if my highscores are in place and i need it to save and load the high score data.
Check to see if points have been assigned - Works
if(!highcombo||!highscore){
high_combo.text="x1";
high_score.text="000pts";
}else{
high_combo.text="x"+highcombo;
high_score.text=highscore+"pts";
}
Sets High Scores and High Combos - Works
if(totalscore<currentscore){
totalscore=calcscore;
}else{
currentscore=calcscore;
}
highscore=totalscore;
//Get High Combo
if(totalcombo<currentcombo){
totalcombo=combo;
}else{
currentcombo=combo;
}
highcombo=totalcombo;
high_combo.text="x"+highcombo;
high_score.text=highscore+"pts";
XML File - Highscore.xml
<?xml version="1.0" encoding="UTF-8" standalone="no" ?>
<application xmlns="http://ns.adobe.com/air/application/3.2">
<score>000</score>
<combo>1</combo>
</application>