4 Replies Latest reply on Feb 7, 2012 7:15 AM by kglad
      • 1. Re: Output to text file
        kglad Adobe Community Professional & MVP

        you can use the filereference class'es save() method.

        1 person found this helpful
        • 2. Re: Output to text file
          Anup-Flash-Help Level 1

          ok so i'm a bit new to flash, any help would be much appreciated as i've never used the save method.

           

          i've got the boolean variable: flag,

          and i want to output it's value to a text file when i press the taketheticket button:

           

          this is was i have so far

           

           

           

          function taketheticket(event:MouseEvent):void

                    {

                              trace("the change is " + flag);

                              gotoAndStop(8);

                    }

          • 3. Re: Output to text file
            Anup-Flash-Help Level 1

            Ok I've managed to do it:

             

            var file:FileReference = new FileReference(); //create a filereference object

            var flag:Boolean = false; // create the variable

             

            function taketheticket(event:MouseEvent):void

            {

                 trace("the change is" + flag); // prints the change value

                 file.save(flag, "result.text"); // saves the value of flag in a text file named result.text

                 gotoAndStop(8); // go to frame 8 and stop

            }

             

            when the method above is exectuted it allows you to select a particular destination.

            • 4. Re: Output to text file
              kglad Adobe Community Professional & MVP

              do you know how to use the flash help files?  if not, you should learn.