How to write text file in Android using Action script 3
Dear
I am writing simple program under LG Optimus which is installed Android 2_3(Gingerbread) . But I cannot access text file or xml file. I am using flash professional CS5_5. Can you check the program? What's wrong with it? It works good in PC when change the path, but not work in Android phone.
----------program---------------
import flash.filesystem.*;
import flash.filesystem.FileStream;
import flash.events.Event;
//txtFld is standard textField component
//btnSaveFile is standard button component
txtFld.text = "Start";
btnSaveFile.addEventListener(MouseEvent.CLICK,handlerBtnSaveFile);
function handlerBtnSaveFile(e:Event){
var f:File = new File();
f.nativePath = "/mnt/sdcard/asdf.txt";
//f.nativePath.replace(/\//g, File.separator);
var stream:FileStream = new FileStream();
stream.open(f, FileMode.WRITE);
txtFld.text = f.nativePath;
stream.writeUTFBytes("This is my text file.");
stream.close();
}
