Ignoring Hidden Files in AIR


/ Published in: ActionScript 3
Save to your folder(s)



Copy this code and paste it in your HTML
  1. private function iterateFiles(dir:File):void
  2. {
  3. if (!dir.isDirectory || dir.isHidden || !dir.exists || dir.name.search(/^\..*$/) != -1) return;
  4. var listing:Array = dir.getDirectoryListing();
  5. for each(var f:File in listing)
  6. {
  7. if (this.fileList.length >= this.MAX_FILES) break;
  8. if (f.isHidden || !f.exists || f.name.search(/^\..*$/) != -1) continue;
  9. if (f.isDirectory)
  10. {
  11. this.iterateFiles(f);
  12. }
  13. else
  14. {
  15. this.fileList.push(f);
  16. }
  17. }
  18. }

URL: http://blogs.adobe.com/cantrell/archives/2009/07/ignoring-hidden.html

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.