Author Options:

flash highscore :S Answered

hey everyone! i made a flash game :D and yer its fairly gd and all for a beginner, however, i need to add a basic (and i mean BASIC) highscore into the game, to make it...well, better lol, any help would be much appreciated, i've searched google and found no relavent tutorials :( so please help! DONE!!! :D i have left a link of the finished game


the way if i want to do it is using loadVars() statement

try o find it in the flash help file

you must have the knowledge of PHP as well

how to pass the variable from actionscript and pass it on to the server using GET

try to google it theres a lot of website a giving a free tutorial

good luck


10 years ago

thanks for the feedback everyone! i was maybe thinking, a code which would enable the highest score to be noted in the top right screen of the page. Only problem is i dont know much actionscript maybe the code would be something like; highscore = highestOf-Score That was a random guess and i'm thinking that code would be no where near correct :S lol, I will try and post the game see what you think :) if i can load it :S

Not to be a contrarian, but my suggestion is to have your flash game, a PHP (or ASP, etc) page, as well as either a DB, an XML file, or a .txt file.

Otherwise, the file holding the scores would have to be world-writeable, which would be bad. By using a server-side page to alter it, it cures the security dilema.

I made this popup game in Javascipt (Actionscript is *very* close to Javascript) about... 2 years ago... This is what I did.

Look into how to load XML in Flash, in order to get the data. To send, make a XML request to the PHP page using GET variables.

Now you need to first decide where you are planning to put the game. Either run it locally from your hard drive, or publish it on a web server.

If you just want a high score, that stores locally into the computer where the game runs, then you can write a script that save the high score variable into a text file (.txt). I've fiddled with fscommand years back (in Flash 5) and it's fairly easy to write and read from text files.

Using the same text file method, but publishing the game on a webserver, then you will need some PHP knowledge, do check out this tutorial

not sure how but you need a database, I think it can be done with .xml databases and some flash coding, basically it saves the values to the databases and calls up the highest ones when the highscores are shown...

. You need to have a persistent variable. One way to do that is to write the high score to a file. I have no idea how to do that in Flash (or if it's even possible).