[AIR] AS3操作文件时报SecurityError: fileWriteResource 错的解决方法
在用File操作(移动,删除等)或者写入文件时,以下写法会报错
var file:File =File.applicationDirectory.resolvePath("1.swf");
正确的写法如下:
var file:File = new File(File.applicationDirectory.resolvePath("1.swf").nativePath); if(file.exists){ file.deleteFile(); }
------------------------------------------------------------------
Always put yourself in the other's shoes.If you feel that it hurts you,it probably hurts others,too.------------------------------------------------------------------