AIR provides a file system API that can be used to write files of any type to the device.
Let us see how to write a text file containing simple preferences data that might, for example, be used by a game.
An FLA has been provided as a starting point for this recipe.
From the book's accompanying support files, open
chapter13\recipe4\recipe.fla into Flash Professional.
Sitting on the stage is a dynamic text field named
output. We will write some preferences data to the device and use the text field to indicate when the data has been written.
How to do it...
flash.filesystem package contains classes that provide file system access. Let us make use of some of those classes to write to the device.
- Create a document class and ...