Adobe AIR copyto
I'm trying to move files from myLocation to the Desktop, but my copyTo syntax is wrong:
var myLocation = new air.File(myVolume);
var files = myLocation.getDirectoryListing();
for (var f=0; f < files.length; f++){
if (!files[f].isDirectory) {
targetFile = air.File.desktopDirectory.resolvePath(files[f].name);
files[f].copyTo(targetFile); // This line doesn't work开发者_StackOverflow社区.
}
}
files[f].moveTo(targetFile,true); // Overwrite
精彩评论