File Browser is a native extension that allows applications to browse the SDcard folder on Android devices. It lets the user pick one or more files using a dialog window listing all files inside the SDcard folder. After the user touches the screen to pick a files, some events are fired so the application can check what is happening.
The extension can be customized to allow single or multi-selection of files. If the user touches a file that is not selected, a “selected” event is fired. If the file was already selected, a “canceled” event is fired. It’s possible to exclude hidden files (or not) in the listing dialog. The application receives the path of the file when it is selected.
The listing dialog also has preview icons (for popular files) and allows search of files and folders.
Sample
import com.doitflash.air.extensions.fileBrowse.FileBrowser; import com.doitflash.air.extensions.fileBrowse.BrowseEvent; var _ex:FileBrowser = new FileBrowser(); _ex.addEventListener(BrowseEvent.FILE_SELECT, onFileSelected); _ex.addEventListener(BrowseEvent.SELECT_CANCELED, onBrowseCanceled); _ex.showHiddenFiles = false; _ex.labels = ["SELECT", "CANCEL"]; _ex.mode = FileBrowser.MULTIPLE; // path to the root of your sdcard _ex.open(File.documentsDirectory.resolvePath("")); function onBrowseCanceled(e:BrowseEvent):void { trace("Browsing canceled") } function onFileSelected(e:BrowseEvent):void { for (var i:int = 0; i < e.param.length; i++) { trace(e.param[i]) } }
RT @as3gamegears: New: File Browser (native extension to browse the SDcard folder on Android devices) http://t.co/XDGQJ99Dqs #as3 #flash #g…
Andrey Kyznetsov liked this on Facebook.
Nice extension, but this can be achieved with pure as3 AIR API.
I know AIR has some APIs for filesystem manipulation, but is it able to show a native dialog for that?