How to use the FileSystem in AIR to find the users directory folders
March 1st, 2008
I was messing around last night with AIR and I stumbled apon this:
- start an AIR app in flash cs3
- add a list component
- name it dir_list
- drop the code below in the actions panel
- And Viola!
- PS – PC people, I put a test to see if My Documents in in that Directory.
[as]
import flash.filesystem.*;
var userDirFiles:Array = File.userDirectory.getDirectoryListing();
for (var i:uint = 0; i < userDirFiles.length; i++) {
if (userDirFiles[i].isDirectory) {
//this.display_txt.text = String(userDirFiles[i].nativePath);
dir_list.addItem({label:userDirFiles[i].nativePath })
var tmpString:String = userDirFiles[i].nativePath;
if(tmpString.search(/My Documents/) != -1)
{
dir_list.addItem({label:”working”});
break;
}
}
} [/as]
Last 5 posts in actionscript
- HOWTO Create a Facebook App using FlexBuilder - June 24th, 2009
- Roman Numeral/Arabic Convertion AIR App - Johnny V Now Available - December 25th, 2008
- How to convert Roman Numerals and Arabic numbers in ActionScript 3 - December 17th, 2008
- Using Flash Player 10 to produce Dynamic Musical Notes - May 20th, 2008
- Flash Player 10 Dynamic Sound Generation - May 20th, 2008
Last 5 posts in Apollo (AIR)
- Abstract Thermometer AIR app - January 22nd, 2009
- Johnny V now available on Adobe AIR Marketplace - December 29th, 2008
- Roman Numeral/Arabic Convertion AIR App - Johnny V Now Available - December 25th, 2008
- Adobe Evangelist Daniel Dura visits Travelocity - April 15th, 2008
- I smell a lawsuit - March 2nd, 2008
Last 5 posts in as3
- HOWTO Create a Facebook App using FlexBuilder - June 24th, 2009
- Guitar Synth for Flash - February 27th, 2009
- Abstract Thermometer AIR app - January 22nd, 2009
- Roman Numeral/Arabic Convertion AIR App - Johnny V Now Available - December 25th, 2008
- How to convert Roman Numerals and Arabic numbers in ActionScript 3 - December 17th, 2008
Last 5 posts in flash
- HOWTO Create a Facebook App using FlexBuilder - June 24th, 2009
- Roman Numeral/Arabic Convertion AIR App - Johnny V Now Available - December 25th, 2008
- How to convert Roman Numerals and Arabic numbers in ActionScript 3 - December 17th, 2008
- Flash Player 10 Pure Flash Keyboard using SampleDataEvent - September 3rd, 2008
- Using Flash Player 10 to produce Dynamic Musical Notes - May 20th, 2008
Last 5 posts in flash CS3
- How to use Bitmap and BitmapData in ActionScript 3 - v2 - April 23rd, 2008
- Yahoo Maps ActionScript 3.0 Released - February 11th, 2008
- Update: Flash/Flex Tidbit #2 How to use Alpha Mask in Flash CS3 - January 8th, 2008
- Custom ColorPicker Component - How to extend a Flash CS3 Component Class - December 13th, 2007
- Tidbit #3 - testing additions to your code - Control Variable - November 28th, 2007
Entry Filed under: Apollo (AIR), actionscript, as3, flash, flash CS3

Leave a Comment
Some HTML allowed:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> <pre lang="" line="" escaped="">
Trackback this post | Subscribe to the comments via RSS Feed