2 Replies Latest reply on Aug 1, 2007 3:28 PM by craus

    Saving text file

    neotype
      HI

      i am try to make a program that saves external text files.
      i have found this script:
      fscommand ("save", name+".txt");

      but this doesn't funtion...
      does anybody know a script??
        • 1. Re: Saving text file
          craus
          // I used the following function to save a 'file' onto the users
          // computer for a chess game.


          Actions.save = function(){
          var my_so:SharedObject = SharedObject.getLocal("file");
          my_so.data.ltblueposx = _root.ltblueposx_array;
          my_so.data.ltblueposy = _root.ltblueposy_array;
          my_so.data.dkblueposx = _root.dkblueposx_array;
          my_so.data.dkblueposy = _root.dkblueposy_array;
          my_so.data.notes_txt = _root.my_txt.text;
          my_so.flush();
          };

          • 2. Re: Saving text file
            craus Level 1
            Actually I don't think that's what you wanted. You won't be able to open the object 'file' with notepad. But here's the load portion anyway.

            Actions.load = function(){
            my_so=SharedObject.getLocal("file");
            _root.ltblueposx_array = my_so.data.ltblueposx;
            _root.ltblueposy_array = my_so.data.ltblueposy;
            _root.dkblueposx_array = my_so.data.dkblueposx;
            _root.dkblueposy_array = my_so.data.dkblueposy;
            _root.my_txt.text = my_so.data.notes_txt;
            };