A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: Local High Score (Flash MX+)

  1. #1

    Local High Score (Flash MX+)

    I'm making a website with a variety of mini games. One day I might get php highscore tables going (when I can figure them out!) but in the meantime I'd like to have the highscores saved locally on the users computer.

    I know I have to use shared objects but I'm finding it difficult to modify the code from a save game tutorial. I'm sure this has been posted somewhere before but a search for "local high score" doesn't seem to be giving me the goods (too many php highscore and pre MX posts)

    Soooo... down to business.
    I have an object called "scorebox" with the dynamic text vars "score" and "highscore".
    Once the game ends I need to compare the score to the highscore. I'm using the following code but I'm not entirely sure if its working (I'm more animator than coder)

    Code:
    if (Number(_root.scoreBox.score) > Number(_root.scoreBox.highscore)) {
    	gotoAndPlay("newHighScore");
    } else if (Number(_root.scoreBox.score) < Number(_root.scoreBox.highscore)) {
    	gotoAndPlay("noHighScore");
    }
    So if the score is greater than the highscore you are congratulated and the highscore is made is equal the score...

    Code:
    if (Number(_root.scoreBox.score) > Number(_root.scoreBox.highscore)) {
    	Number(_root.scoreBox.highscore) == Number(_root.scoreBox.score)
    }
    THEN I need the new highscore saved to the users computer so that next time they play the game it retrieves it the start.

    If anyone can give me any pointers or direct me to a previous thread on the subject that would be great!

    Thankyou very much everyone!
    Francesca

  2. #2
    Game Player - Developer scheletro's Avatar
    Join Date
    Mar 2005
    Location
    México living in Barcelona
    Posts
    1,122
    There you are
    Attached Files Attached Files


    "I love to make them as I love to play them"

  3. #3
    Quote Originally Posted by scheletro
    There you are
    You star, thankyou!

    Whew the coding is a bit on the tough side for me... I'm going to have to stare at this a while to try and understand whats going on.
    Wish me luck

  4. #4
    Oooo another quick question...

    Is it a good idea to use this for a website with multiple games?

    I worry about maxing out on the shared object filesize... or users getting sacred off by security warnings when the scores try to save to their computers(?)

    Has anyone had any bad experiences using local highscores?
    Thanks again

  5. #5
    Game Player - Developer scheletro's Avatar
    Join Date
    Mar 2005
    Location
    México living in Barcelona
    Posts
    1,122
    I never use local scores for a web page, just for the games i give for free in my webs and just because the people wants that, a score table, and this one works very fine, don't worry about understand, the table works and if you don't want to have anuything on your machine just clear the list

    For games in web pages better use php score tables, pearl, mysql, cgi or what ever

    glad to hear that the table was what you needed


    "I love to make them as I love to play them"

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center