A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: High Scores Table

  1. #1
    Senior Member
    Join Date
    Oct 2000
    Posts
    184

    High Scores Table

    Hi All,

    I need to build a high scores table for a maths game I have built. It should keep track of the highest 8 scores and sort them into the correct order of highest in first place...

    If I use the xml connector is there a way to sort the order in actionscript?? If not then I'll have to pass the name, score and school out as a querystring and use ASP to build a text file.

    Any ideas anyone???

    Cheers for any advice...

  2. #2
    Senior Member cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,448
    You can collect the data in an array and use sortOn.

    myArray = new Array(4,6,2);
    myArray.sortOn(Array.NUMERIC);
    trace(myArray);
    - The right of the People to create Flash movies shall not be infringed. -

  3. #3
    Senior Member
    Join Date
    Oct 2000
    Posts
    184

    Do you mean from an xml file?

    Hi

    Can I set up the same xml connector to both read and write?

    (I presume I can as I'm trying at the mo and my book says I can) However its not working so I guess that it will be easier if I have one to read in the previous High Scores and one to write out the user details when a new high score is reached???

    I was reading about sortOn too. Can I create an array straight from my xml file once it is in flash??

    Cheers for the help

    M

  4. #4
    Senior Member cancerinform's Avatar
    Join Date
    Mar 2002
    Location
    press the picture...
    Posts
    13,448
    Yes, you just add the childNodes to the array and once all nodes are added you sort the array. Here is one possibility.

    myArray.push(myXML.childNodes[count]);
    count++;
    if (count >= myXML.childNodes.length)
    {
    myArray.sortOn etc, etc
    }
    - The right of the People to create Flash movies shall not be infringed. -

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