Posted By

GrfxGuru on 01/31/11


Tagged

file actionscript text external AIR saving


Versions (?)

Who likes this?

4 people have marked this snippet as a favorite

kure69
onemanstudio
carface
Praimen


Adobe AIR - Save text to local text file


 / Published in: ActionScript 3
 

  1. public var file:FileReference = new FileReference();
  2.  
  3. public function doSave( event:Event ):void
  4. {
  5. // txtField is the instance name of a text field with contents to save.
  6. var data:ByteArray = new ByteArray();
  7. data.writeMultiByte ( txtField.text, "utf-8" );
  8. file.save( data, "myfile.txt" );
  9. }

Report this snippet  

You need to login to post a comment.