A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: Swish 1 - SharedObject

  1. #1
    Member
    Join Date
    Jul 2008
    Location
    Arizona
    Posts
    31

    Swish 1 - SharedObject

    Hey All,

    Finally figured out how to use sharedobject in swish, but now I am having a trouble loading the variables I save...

    On the Scene:

    Code:
    onLoad() {
         my_var = SharedObject.getLocal("save_file");
         gamescore = 0;
    }
    onEnterFrame() {
         score.text = _root.gamescore;
    }
    On a button to increase score:

    Code:
    onSelfEvent (press) {
        _root.gamescore += 1;
    }
    On a save button which seems to work somewhat:

    Code:
    onSelfEvent (press) {
        my_var.data.gamescore = _root.gamescore;
    }
    On the load button:

    Code:
    onSelfEvent (press) {
        _root.score.text = "";
        _root.gamescore = my_var.data.gamescore;
    }
    Then there is a dynamic text box to display score...

    Basically, I increase score a few times up to lets say, 5. I click save. Then I close the program. I open the program, click load and the textbox displays "undefined" for the score, instead of loading it. Any ideas why?

  2. #2
    Flashkit historian Frets's Avatar
    Join Date
    Oct 2000
    Location
    flashkit
    Posts
    8,797
    incomplete information. Nothing you've shown demonstrates .so
    Can't test so inside swishmax you have to export the swf before testing.


    You might want to try the sz forums. when you do supply an swi so they can look under the hood.
    http://forums.swishzone.com

  3. #3
    Member
    Join Date
    Jul 2008
    Location
    Arizona
    Posts
    31
    not sure what else you need, there are like 4 objects in the .swi, heh.

    I test in player exporting with SWF8 not inside swish itself.

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