4 Replies Latest reply on Jan 8, 2007 9:00 AM by Newsgroup_User

    writing to HD

    Level 7
      I need a Flash application to write something on to the hard drive (to
      itself or to another file). The application is supposed to run on a
      stand-alone computer, no connection to other computers, no Internet.
      Is it possible to do that with FLASH means without installing ASP, PHP or
      other add-ons?


        • 1. Re: writing to HD
          MJQTREBLE
          There are two ways to do this, depending on what you require this for:-

          The simplest way is to use a shared object ( http://www.adobe.com/support/flash/action_scripts/local_shared_object/). This works like a cookie - you can save values on the machine, which can then be retrieved at a later date by the same application.

          The other way is to use fscommand to call an executable file which will write to the hard drive. I have used this method in the past by writing to the clipboard in the actionscript, and calling an .exe file which I wrote using c++. The .exe file then reads the data from the clipboard, and writes to the file. This method is a bit more complicated but has versatility if that's what you require.
          • 2. Re: writing to HD
            Level 7
            > There are two ways to do this

            Make that 3 - there are many 3rd party wrappers available for Flash that
            allow OS level control. Take a look at HaXE, mProjector, Jugglor, Zinc 2
            etc. Or (my preferred option), use Director to build a shell for your Flash
            movie.

            --
            -------------------------------
            Remove '_spamkiller_' to mail
            -------------------------------


            • 3. Re: writing to HD
              Level 7
              Thanks.
              1. The shared object - I cannot see from the URL you supplied if it is
              perichable like cookie, or it can be persisrnt like an ordinary file? Also
              can a shared object created by one SWF be read by another SWF?

              2. use fscommand to call an executable file - is it necessary to write
              first to the clipboard? Or I can pass to the EXE what to write as a
              parameter when using fscommand?
              I guess that a C (or VB or PERL) executable which takes a value as a
              parameter and writes it into a text file or a database (say Access) should
              be trivial.

              "MJQTREBLE" <webforumsuser@macromedia.com> wrote in message
              news:ent6ru$jo2$1@forums.macromedia.com...
              > There are two ways to do this, depending on what you require this for:-
              >
              > The simplest way is to use a shared object
              > ( http://www.adobe.com/support/flash/action_scripts/local_shared_object/).
              This
              > works like a cookie - you can save values on the machine, which can then
              be
              > retrieved at a later date by the same application.
              >
              > The other way is to use fscommand to call an executable file which will
              write
              > to the hard drive. I have used this method in the past by writing to the
              > clipboard in the actionscript, and calling an .exe file which I wrote
              using
              > c++. The .exe file then reads the data from the clipboard, and writes to
              the
              > file. This method is a bit more complicated but has versatility if that's
              what
              > you require.
              >


              • 4. Re: writing to HD
                Level 7
                This is very easy if you use mProjector to create your exe. mProjector
                adds several new classes into flash including one called mFile

                the code is very straight forward something like this

                mFile.writeString("fileName", "A string to write");

                here is a link to the mFile class docs

                http://www.screentime.com/software/mprojector/docs/index.html#mFile

                another call that may be of of interest is getSpecialFolder, which
                returns a path to a folder based on selector for example

                var data:String = "Hello";
                var folderPath:String = STF.getSpecialFolder("DOCUMENTS");
                mFile.writeString(folderPath+"/test.txt", data);




                On 2007-01-08 04:07:08 -0500, "aa" <A@aa.com> said:

                > I need a Flash application to write something on to the hard drive (to
                > itself or to another file). The application is supposed to run on a
                > stand-alone computer, no connection to other computers, no Internet.
                > Is it possible to do that with FLASH means without installing ASP, PHP or
                > other add-ons?