A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: top scores coming along, but a few Q's

  1. #1
    Member
    Join Date
    Feb 2002
    Posts
    71
    I'm making some progress on the top-ten score idea using an adapted version of Bret's PHP/MySQL script (thanks Bret!). You can see where I am with it so far at http://www.pedaplus.com/flash/2_note_int_scores.swf

    I have not worked out the code for adding a new score yet. The variables from the server are loaded into the high-scores child movie and show up as raw data in a couple of edit boxes after you press the "scores" button on the right. You will see that the raw scores and names will be sorted from highest to lowest. I did this by building an initial array, and then emptying it one item at a time, building a new array with the highest to lowest scores in order. Is there an easier or more efficient way to do this? I just kept the array with the names using the same index as the scores, and built it at the same time as the scores.

    I could also use suggestions on the most efficient way to get the new scores/names into the existing arrays and send them to the server. still working that out.

    See ya,
    Jon E

  2. #2
    KoolMoves Moderator blanius's Avatar
    Join Date
    Jul 2001
    Location
    Atlanta GA
    Posts
    5,244
    with the command add (i.e. musicgame.php?cmd=add)

    It will UPDATE - replace the record pointed to by Mid so be sure to set this.
    The date will update with the current date.

    The way the php is written it updates one record only so once you figure out where in the list it goes you can the one by one update from that Mid and up to the lowest score.

    It would be possible to rewrite the PHP to do this for you and all you do is send the array back just like you recieved it but with the new score in place.


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