3 Replies Latest reply on Apr 8, 2012 10:36 AM by kglad

    Saving textfield input



      I posted this question in a different form yesterday but as it's changed I've reposted it with all the info.

      I'll explain a little before asking my question ... I've created numerous games which load and unload off a main menu.

      The player enters their name on the main menu before playing any games and when the player completes a game I want to save their time (taken to complete the game) and unload this time back into the main menu.

      Is there any way of saving the times using AS3 to a word document or something like this? I can't send the times to my website with php because the games will be used within a competition and it all needs to work with the internet.

      Any ideas guys?

        • 1. Re: Saving textfield input
          kglad Legend

          you can use a sharedobject to save data to the user's computer:


          var so:SharedObject=SharedObject.getLocal("antb90");

          so.data.game1time=whatever;  // to set data.  use an if-statement to check is alredy defined.






          1 person found this helpful
          • 2. Re: Saving textfield input
            AntB90 Newcomer



            Is the antb90 something to do with the name of my computer?


            Say my main menu is called MainMenu.swf and the first time is called GameOne.swf.


            Would the code look like this?


            var so:SharedObject=SharedObject.getLocal("Ant");

            so.data.GameOne.swf=whatever;  // to set data.  use an if-statement to check is alredy defined.



            Also what does the text whatever need to be replaced with?


            Thanks for the reply.

            • 3. Re: Saving textfield input
              kglad Legend

              check the flash help files, as3 classes, SharedObject. 


              there's sample code and more.