A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: [ HELP ] How to make basic Save/Load system?

  1. #1
    I'm not Crazy :D
    Join Date
    Nov 2015
    Location
    Brazil [<o>]
    Posts
    86

    Question [ HELP ] How to make basic Save/Load system?

    Hey Flashkit , how to make basic load/save system?

  2. #2
    Member
    Join Date
    Sep 2014
    Posts
    75
    Quote Originally Posted by CrazY. View Post
    Hey Flashkit , how to make basic load/save system?
    On stage:

    1- You need to create two text fields; one as an Input text field (give it an instance name e.g. saveText) and the other as a Dynamic text field (give an instance name e.g. loadText).
    2- Create three buttons and give each one an instance e.g. saveBtn , loadBtn , clearBtn
    3- On the first frame on stage, paste the following code:

    _root.saveText.text = "";
    _root.loadText.text = "";
    //
    Info = SharedObject.getLocal("saveData");
    //
    _root.saveBtn.onRelease = function() {
    //Save Data.
    Info.data.center = _root.saveText.text;
    };
    //
    _root.loadBtn.onRelease = function() {
    //Load Data.
    if (Info.data.center == undefined) {
    _root.loadText.text = "";
    } else {
    _root.loadText.text = Info.data.center;
    }
    };
    //
    _root.clearBtn.onRelease = function() {
    //Clear Data.
    Info.data.center = undefined;
    _root.saveText.text = "";
    _root.loadText.text = "";
    };

    4- Test the file.
    In the input text field write any text or number you like then press save. Now if you press the load button the text you entered in the input text field will be loaded in the dynamic text field. Pressing clear button will clear the data from the memory.

  3. #3
    Member
    Join Date
    Sep 2014
    Posts
    75

  4. #4
    I'm not Crazy :D
    Join Date
    Nov 2015
    Location
    Brazil [<o>]
    Posts
    86
    Thank you body :P

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