Search code examples
xmlflashactionscript-3

How to Create a New XML File and Write to it in Flash with ActionScript 3?


I am writing a program and want to take store user inputs into a XML document.

Example

Try for XML File's Existence

Catch Create XML File

I also want the options to: Write to that file Read from that file with Array usage

Security is no issue. This is a local file with no needed security.

How would I do this using AS3. Any good tuts?

Thanks!


Solution

  • I've done exactly what you're proposing, successfully, with an Adobe Air project. You can also use MDM Zinc, but that's a paid product.

    I used File.save() to create an .xml file in local storage for retrieval later. However, it will open dialog box every time, so a class that updates that file once you have it's filepath would be awesome.

    http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/net/FileReference.html#save()

    Hope that helps!

    J