Skip to main content
Participating Frequently
April 15, 2013
Answered

How do i create a highscore table?

  • April 15, 2013
  • 1 reply
  • 1754 views

currently have my score showing through my score variable, which comgratulates the user and says their score.

but

How do i create a high score table which shows the users score every time he plays my game?

function displayScoreBox()

    {

   

   

    displayScore.text = " Well done. You Scored " + score

    }

displayScoreBox();

stop();

This topic has been closed for replies.
Correct answer Ned Murphy

You need to store the score somewhere.  If the intention is to store it locally on the user's machine then you either need to develop this as an AIR application where you can save data to a file, or if it is an online application then you need to make use of the SharedObject class which is Flash's version of cookies.

1 reply

Ned Murphy
Ned MurphyCorrect answer
Legend
April 15, 2013

You need to store the score somewhere.  If the intention is to store it locally on the user's machine then you either need to develop this as an AIR application where you can save data to a file, or if it is an online application then you need to make use of the SharedObject class which is Flash's version of cookies.

Participating Frequently
April 15, 2013

Luckily i am using it in AIR, would storing it in a 'PHP' document work?

Ned Murphy
Legend
April 15, 2013

It might, but it would be unnecesary.  AIR can store a data file on the user's system (Which is not likely to have PHP available).  Try searching Google using terms like "AIR AS3 save file". 

Then you just need to decide how you want to format the stored data, which could be either xml or plain text and name/value pairs.