8 Replies Latest reply on Feb 16, 2007 9:06 AM by Peter Lorent

    Can Flash write data to the hard drive?

    lumpthing
      I was planning to create a flash application which would involve saving data to the hard drive as save files (in the same way that MS Excel and Word do). Unfortunately I have recently been told that this is not possible. Apparently Flash can read but not write data to the disk; it can only write data to servers. Is this true? It would seem to be massive limitation if it is.

      I wanted to create this application for pocket pcs (which support Flash Player 7), if that is relevant.
        • 1. Re: Can Flash write data to the hard drive?
          Level 7
          lumpthing,

          > I was planning to create a flash application which would
          > involve saving data to the hard drive as save files (in the
          > same way that MS Excel and Word do).

          If you're asking whether Flash can save .xls and .doc files, the answer
          is a definite no -- but I think you were just using Excel and Word as
          examples.

          > Unfortunately I have recently been told that this is not
          > possible. Apparently Flash can read but not write data to
          > the disk; it can only write data to servers. Is this true?

          Flash can read all sorts of external data, including (at least) text
          files, CSS, XML, JPG, PNG, GIF, and SWF. Generally speaking, Flash cannot
          write file's to the user's machine. There's one exception, and that's
          so-called "Flash cookies," or .sol files. These are created in conjunction
          with the SharedObject class and can store any datatype available to Flash,
          including (I believe) instances of the BitmapData class. But these aren't
          what you would consider "files" in the everyday sense of the word. They're
          essentially cookies.

          Writing data to servers is, of course, dependent on your server
          platform.

          > It would seem to be massive limitation if it is.

          It should only seem that way if your expectations led you to believe
          Flash was designed to produce desktop applications. In actuality, Flash is
          designed to produce web content, including web applications, and so its lack
          of native File I/O is primarily a security feature (not a failing). There
          are 3rd party applications (Zinc and Jugglor come to mind) that extend the
          native capabilities of Flash, and this is a viable workaround for many
          developers.

          > I wanted to create this application for pocket pcs (which
          > support Flash Player 7), if that is relevant.

          The SharedObject class may just work for you, then. If you want more
          power than Flash gives you, then .NET or Java may be a closer match for your
          needs -- though the learning curve is much higher, and multimedia support
          much more difficult.


          David Stiller
          Adobe Community Expert
          Dev blog, http://www.quip.net/blog/
          "Luck is the residue of good design."


          • 2. Re: Can Flash write data to the hard drive?
            Level 1
            Hi,

            it is possible to save data to the hard drive via the ShareObject; wich is a Flash cookie. It is the only way to save data on the client side. It is still pretty limited but maybe you will achieve what you want to do with the sharedObject.

            Butcho
            • 3. Re: Can Flash write data to the hard drive?
              Level 7
              As David mentioned there are a few 3rd party "wrapper" applications that
              will allow you to save files to the user's machine. Adobe's own Director is
              a prime example.

              Here's a few others:
              http://www.screentime.com/software/mprojector/
              http://www.northcode.com/
              http://www.swishzone.com/index.php?area=products&product=studio
              http://flashjester.com/?section=tricks_jugglor2
              http://www.multidmedia.com/

              --
              Dave -
              Head Developer
              www.blurredistinction.com
              Adobe Community Expert
              http://www.adobe.com/communities/experts/


              • 4. Re: Can Flash write data to the hard drive?
                lumpthing Level 1
                After reading all your excellent replies I went off to investigate SharedObjects. All I want to do is save simple string and number variables for re-use in Flash Player; so, if my understanding is correct, it seems SharedObjects can do the job just fine.

                David Stiller: you're entirely right Flash was designed for the web, not for desktop applications, so I shouldn't have claimed this was a massive limitation. I did hear that Adobe was intending on increasing Flash's viability as a programming language for a broader range of uses though.
                • 5. Re: Can Flash write data to the hard drive?
                  Level 7
                  lumpthing,

                  > David Stiller: you're entirely right Flash was designed for
                  > the web, not for desktop applications, so I shouldn't have
                  > claimed this was a massive limitation.

                  's okay. :)

                  > I did hear that Adobe was intending on increasing Flash's
                  > viability as a programming language for a broader range
                  > of uses though.

                  ActionScript 3.0 brings that to light in a very strong way. Flex
                  Builder 2, for example, is a coding IDE -- not unlike Visual Studio or
                  JBuilder -- that produces SWFs playable in Flash Player 9. There are no
                  drawing tools and no timelines in Flex: just code. The new syntax and APIs
                  are a complete overhaul of ActionScript, which indeed increases Flash's
                  viability as a programmer's platform. Flash 9 will presumably also publish
                  to ActionScript 3.0. That said, both Flash and Flex are still primarily
                  aimed at web applications.

                  Adobe has an application in the works, called Apollo, that combines the
                  Flash Player and Acrobat Reader. I don't know a whole lot about it, but
                  it's geared toward a combination of desktop and web use.

                  http://labs.adobe.com/wiki/index.php/Apollo


                  David Stiller
                  Adobe Community Expert
                  Dev blog, http://www.quip.net/blog/
                  "Luck is the residue of good design."


                  • 6. Re: Can Flash write data to the hard drive?
                    Peter Lorent Level 2
                    >>Flash 9 will presumably also publish to ActionScript 3.0.
                    Presumably? The Public Alpha publishes to AS3. I can't imagine that they will bring out a 9 without AS3???
                    • 7. Re: Can Flash write data to the hard drive?
                      Level 7
                      LuigiL,

                      >>>Flash 9 will presumably also publish to ActionScript 3.0

                      > Presumably? The Public Alpha publishes to AS3. I can't
                      > imagine that they will bring out a 9 without AS3???

                      Heh, well ... fair enough. :) That's just me guarding my words. I
                      would solidly bet on it that Flash 9 supports AS3.


                      David Stiller
                      Adobe Community Expert
                      Dev blog, http://www.quip.net/blog/
                      "Luck is the residue of good design."


                      • 8. Re: Can Flash write data to the hard drive?
                        Peter Lorent Level 2
                        >>That's just me guarding my words.
                        Ok, I understand. If they release a 9 without AS3, I'll use another compiler...