How to write text file in Android using Action script 3
dear
i writing simple program under lg optimus installed android 2_3(gingerbread) . cannot access text file or xml file. using flash professional cs5_5. can check program? what's wrong it? works in pc when change path, but not work in android phone.
----------program---------------
import flash.filesystem.*;
import flash.filesystem.filestream;
import flash.events.event;
//txtfld standard textfield component
//btnsavefile 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 text file.");
stream.close();
}
have tried:
"stream.open(f, filemode.read)"
? (without quotes)
More discussions in AIR Development
adobe
Comments
Post a Comment