ITeye博客

air遍历目录里的文件

Fis · 2015-02-12 15:52 · AS · 工作历程 · 移动开发 · Markdown

air开发移动应用时,用于遍历一个目录里的所有文件:

var file:File = File.applicationDirectory.resolvePath("xxx"); var fileList:Array = file.getDirectoryListing(); for each(var f:* in fileList) { this.checkPath(f); }

_fileList = ; private function checkPath(file:File):void { if (file.isDirectory) { var list:Array = file.getDirectoryListing(); for each(var f:* in list) { this.checkPath(f); } }else { _fileList.push(file); } }

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。