[osflash] Q: Browsing to desktop folder to get list of files
iteratif at free.fr
iteratif at free.fr
Wed Oct 8 14:15:33 PDT 2008
Hello ;)
> moveup at mac.com wrote:
> Is is possible in an AS3 desktop app, or projector, or using AIR, (NOT
> from within a browser), to browse to a desktop folder and get
>
> 1- a list of the file contents or file names
> 2-file sizes
> 3- the file icon
>
> Essentially what I'm trying to create is a desktop browser...
this possible, example :
import flash.filesystem.*;
var file:File = new File();
file.addEventListener(Event.SELECT, onSelectedDirectory);
file.browseForDirectory("Select folder");
function onSelectedDirectory(e:Event) {
var items:Array = file.getDirectoryListing();
for each(var f:File in items) {
trace(f.name, f.size);
trace(f.icon.bitmaps[0]);
// bitmaps[0] : BitmapData 128 x 128
// bitmaps[1] : BitmapData 48 x 48
// bitmaps[2] : BitmapData 32 x 32
// bitmaps[3] : BitmapData 16 x 16
}
}
iteratif
++
More information about the osflash
mailing list