views:

741

answers:

4

As far as I know, Flash has to pass info off to another external process in order to save files - POSTing to PHP or talking to an executable, right? But every once in a while I hear rumors that Flash is able to open a file, make changes, then save/write those changes, all on its own - is it possible?

+3  A: 

The next version of the player, Flash 10 can do this. It also has support for some other nifty stuff like simple 3D and typed arrays. The flash player running inside AIR can also do this.

grapefrukt
A: 

There is something called Local Shared Object, also known as "Flash Cookie" that allows you to store a limited amount of data locally at a user's computer.

A little googling turned up a few links:

And I'm sure a little creative googling can turn up even more

Daniel Bruce
yeah, I knew about those, but that's not really what I'm going for.
matt lohkamp
+1  A: 

There are lots of security issues around the behavior you just described so Adobe put many sandbox restrictions around file modification behavior. Even with Flash Player 10, expect a requirement that the file manipulation require that the code be executing in response to a mouse event.

marstonstudio
+4  A: 

This will be available in Flash Player 10:

Reading and Writing Local Files in Flash Player 10

http://www.mikechambers.com/blog/2008/08/20/reading-and-writing-local-files-in-flash-player-10/

Otherwise you need to use Adobe AIR, or bounce it off the server.

mike chambers

[email protected]

mikechambers
that's what I figured - I should've specified I was working in Flash 9 / AS3
matt lohkamp
My suggestion is to build in support for both methods. Then at runtime, check if the user is running v.10, then save directly, otherwise bounce it off the server.
davr
@davr - will users with the v9 plugin be able to see swf s exported as v10? Or are you suggesting serving up an alternate swf (with a version-appropriate save method) depending on which one they've got installed?
matt lohkamp