用 File.applicationDerectoryPath.resolv("text.txt")会报SecuriyError错误!
解决:
var _Path:File = File.applicationDirectory;
var _url:String = _Path.nativePath.toString();
_url+= "/test.txt";
var file:File = new File(_url);
var stream:FileStream=new FileStream;
stream.open(file, FileMode.WRITE);
stream.writeUTFBytes(input.text);
stream.close();
或是
把这句话var file:File =File.applicationDirectory.resolvePath("musiclist.xml");;
改成:var file:File =new File(File.applicationDirectory.resolvePath("musiclist.xml").nativePath);
要将file的文件地址改成全路径的,不能是相对路径的
转:用 File.applicationDerectoryPath.resolv("text.txt")会报SecuriyError错误!
用 File.applicationDerectoryPath.resolv("text.txt")会报SecuriyError错误!
最新推荐文章于 2017-10-27 15:03:00 发布