Browsing for multiple files on a user’s computer using Adobe AIR
In a previous example, “Browsing for individual files on a user’s computer using Adobe AIR”, we saw how you could browse for a single file on the user’s computer in Adobe AIR by calling the browseForOpen() method on a File object.
The following example shows how you can browse for multiple files on the user’s computer in Adobe AIR by calling the browseForOpenMultiple() method on a File object.
Full code after the jump.
<?xml version="1.0" encoding="utf-8"?> <!-- http://airexamples.com/2008/12/23/browsing-for-multiple-files-on-a-users-computer-using-adobe-air/ --> <mx:WindowedApplication name="File_browseForOpenMultiple_test" xmlns:mx="http://www.adobe.com/2006/mxml" layout="vertical" verticalAlign="middle" backgroundColor="white" width="1000"> <mx:Script> <![CDATA[ private var file:File; private function btn_click(evt:MouseEvent):void { file = new File(); file.addEventListener(FileListEvent.SELECT_MULTIPLE, file_selectMultiple); file.browseForOpenMultiple("Please select a file or three..."); } private function file_selectMultiple(evt:FileListEvent):void { dataGrid.dataProvider = evt.files; dataGrid.visible = true; } ]]> </mx:Script> <mx:ApplicationControlBar dock="true"> <mx:Button id="btn" label="Click to browse" click="btn_click(event);" width="100%" /> </mx:ApplicationControlBar> <mx:DataGrid id="dataGrid" visible="false" width="100%" height="100%" /> </mx:WindowedApplication>
- Share this:
2 Responses to Browsing for multiple files on a user’s computer using Adobe AIR
Leave a Reply Cancel reply
http://get.adobe.com/air/- Platform ActionScript Language Reference
Recent Posts
- Detecting the number of screens on a users system in Adobe AIR
- Opening a new NativeWindow in Adobe AIR
- Detecting the line-ending character sequence used by the host operating system in Adobe AIR
- Displaying a custom title bar icon in a WindowedApplication container in Adobe AIR
- Setting a custom text style on the status bar on a WindowedApplication container in Adobe AIR
- Keeping a WindowedApplication on top of other windows in Adobe AIR
- Specifying whether a new Window is focused in Adobe AIR
- Opening a new Window in Adobe AIR
- Setting the file size display mode in the Flex FileSystemDataGrid control in Adobe AIR
- Sorting the FileSystemDataGrid control by date in Adobe AIR
Archives
- March 2010 (10)
- February 2009 (3)
- January 2009 (6)
- December 2008 (44)
Hi there,
I am just learning how to use Flex/Air. I have created an Air application and I wan to browse in a specific folder located in another computer. In my case I want to explore a folder like: \\127.0.0.5\apache\webapp\logs
My application will run only from inside the network… Any guidance?
Hello,
Is it possible to browseForOpenMultiple and constraint the Windows Explorer to display only directory ? (rather than files and directory)
Thanks a lot,