> No, I understand how to get from XML to the DB, but if the Flash file is
> running directly on a client machine (CF not installed and no internet
> connection) how do I get Flash to write the input to a text or xml file
> for upload later?

You can't get Flash to save a .txt file on the client on it's own.  To do
that, you'll need a 3rd party projector creator (Something SWF Studio, Flash
Jester, or ScreenWeaver).  ScreenWeaver is my projector-creator of choice.

Then, each projector creator offers an ActionScript API to enable some
"advanced" features like writing to a text file.  In ScreenWeaver, you could
do something like this:

var fileName = "something.txt"
var contents = "Hey, this is what should be placed in the file";
var bAppend = false; // don't append if the file already exists

function onFileSave(success) {
    if (success) {
        // file saved ok
    } else {
        // file could not be saved
    }
}

swFile.saveString(fileName, contents, bAppend, onFileSave);

The other option, if you don't want to go the 3rd party route, is to uses
Shared Objects in Flash (requires Flash MX).  You can do this natively in
Flash, but it won't create a text file.. it creates a binary file that you
can read in later.

Shared Objects look like this:

myData = SharedObject.getLocal("someData");
if (myData.data.content.length) {
    // content stored.. we can retrieve the value by referencing:
myData.data.content
}

// set some data
myData.data.content = "This is some text to save for later";
myData.flush();  // write the contents immediately

Good luck..

-d
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to