Reading multiple files in a folder

Hi,

I am new in using open fl. I would like to ask if there is a way to read files inside a folder that is similar to all platforms? I am used to reading files from flash applicationstoragedirectory or applicationdirectory. Found some info on haxe (http://code.haxe.org/category/beginner/using-filesystem.html) - under Recursive loop through all directories / files topic - but it does not support js and flash/actionscript.

or something similar to this>http://snipplr.com/view/25109/

Any help would be greatly appreciated.

I don’t know a lot information about this either, but as I’m aware, js/flash cannot read client filesystem (apart from some special cases like for example Node.js), only load files from server, files which user selects via file dialog, or access files stored by them in browser memory. What exactly are you trying to do?

2 cases for my purpose:

  1. I’m trying to access filenames inside the application storage directory at runtime. From my previous projects in flash where we save assets (.txt, pngs, jpgs) in the application storage directory, then the client will just get those at a particular point in time.
  2. I could use the same technique, where I just read all assets in a directory, get the path of each one, and use Starling’s AssetManager to load those files.

btw, im using haxeling. Im currently making a framework to run on html5, flash, and mobile platforms.

Thanks.

Here’s some source code that might help:

Haxe has an #if sys define for “system” platforms (that support APIs such as sys.io.File, sys.FileSystem and sys.io.Process).

There’s more documentation here:

http://api.openfl.org/sys/FileSystem.html

Thanks singmajesty! I’ll take a look at the docs.