A Flash Developer Resource Site

Results 1 to 5 of 5

Thread: HELP scoreboard with shared objects

Threaded View

  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

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