A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: HELP scoreboard with shared objects

  1. #1
    Junior Member
    Join Date
    Jun 2007
    Posts
    20

    HELP scoreboard with shared objects

    Hi,

    I've done this flash scoreboard with shared objects.
    but what i can done is it will replace the 1st score in my scoreboard, it won't have 2nd, 3rd, 4th and etc...

    the script i used is:

    Actionscript Code:
    submit_btn.onPress = function()
    {
        //create a new sharedObject called 'userName'
        var mySharedObject:SharedObject = SharedObject.getLocal("userName");
        var mySharedObject2:SharedObject = SharedObject.getLocal("userScore");
        //assign (data) the sharedObject (mySharedObject) a var called 'name1', which has the value of whatever is in textField 'save_txt'
        mySharedObject.data.name1 = save_txt.text;
        mySharedObject2.data.name2 = save2_txt.text;
        //write the data to the sharedObject
        mySharedObject.flush();
        mySharedObject2.flush();
        gotoAndStop(2);
    };

    Actionscript Code:
    //load yoru sharedObject called 'userName'
    var mySharedObject:SharedObject = SharedObject.getLocal("userName");
    var mySharedObject2:SharedObject = SharedObject.getLocal("userScore");
    //grab the variable 'name1' and put the VALUE in a textField called read_txt
    read_txt.text = mySharedObject.data.name1;
    read2_txt.text = mySharedObject2.data.name2;

    I want to have each higher score goes to the scoreboard, so will have 10 highest score in my scoreboard.

    here is my attached file in CS5 format.
    Attached Files Attached Files

  2. #2
    Moderator whispers's Avatar
    Join Date
    Mar 2001
    Location
    CFA2h (respect the HEX)
    Posts
    12,755
    I'll need it in CS3 format if you want my help..

    also.. Im no clear on what it is you want done as your end result?

    if you want to save more data to the SO.. then do so.. maybe try saving an ARRAY of your high scores?

  3. #3
    Junior Member
    Join Date
    Jun 2007
    Posts
    20
    Ah, sorry

    here is the CS3 format...sorry for reply for so long...
    Attached Files Attached Files

  4. #4

  5. #5
    Junior Member
    Join Date
    Jun 2007
    Posts
    20
    I want to show the score in the 1st frame in another dynamic text box for both names and score.

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