PDA

View Full Version : [AS2] Highscore list


ImOnCloudNine69
03-25-2009, 07:47 PM
I have a basic flash game. Its an Offshoot of Raiden X. Not important. Anyway.

I keep track of their score in a Dynamic Text Box.
I need some way to save and compare it with other scores. this will most likely never be online, only on a school server of which i could read/write to a text file or anything you would suggjest. the file should be local (hosted on the server same place as the game).

Any ideas are appreciated.

i use this code to read positions from a text file for MC's, i could easily modify it to read a highscore board. i need to be able to write back to this text file. if this is the suggjested course of action.

var txt:String;
myLoadVar = new LoadVars();
myLoadVar.load("Enemies1.txt");
myLoadVar.onLoad = function(success) {
if (success == true)
{
txt = myLoadVar.xStart
en1_xstart = txt.split("\r");
}
};


my idea is that i would keep the numbers in an array after reading them in and just sort the array to write out the top 10 or whatever numbers.

bluemagica
03-26-2009, 06:44 AM
since this is for local use, you should go with SharedObjects ..... its better cause in SO you can save data from flash, as it is! So you can save an entire array and read it back at anytime! SO no splitting or such hasseles!
As for highscore, you thought right, just sort them using Array.SortOn...