Reading File names inside a folder in Adobe AIR
Posted by Shardul Singh Bartwal on October 31, 2010
Reading the file names(including the folder names) in adobe air is a straight forward task.You have to decide the folder location i.e. desktop,document or application folder etc. And then you can get the file listing of that folder very easily. As I have done for a folder which is on my desktop.Below is code for the same.
<?xml version="1.0" encoding="utf-8"?> <mx:WindowedApplication xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" creationComplete="getFolder()"> <mx:Script> <![CDATA[ private function getFolder() : void { var dir : File = File.desktopDirectory.resolvePath("MyFolder"); dir.getDirectoryListingAsync(); dir.addEventListener(FileListEvent.DIRECTORY_LISTING,onDirectoryListComplete); } private function onDirectoryListComplete(event : FileListEvent) : void { var cont : Array = event.files; for (var i : uint = 0;i<cont.length;i++) { trace(cont[i].name + "....." + cont[i].size); } } ]]> </mx:Script> </mx:WindowedApplication>
Flex learner | Blog | Reading File names inside a folder in Adobe AIR « BTA Flexing said
[…] Continue reading here: Reading File names inside a folder in Adobe AIR « BTA Flexing […]
Vintage 1970′s Drag Racing – rare footage | Image Central Drag Racing said
[…] Reading File names inside a folder in Adobe AIR « BTA Flexing […]
Electric Drag racing: White Zombie | Image Central Drag Racing said
[…] Reading File names inside a folder in Adobe AIR « BTA Flexing […]
DRAG RACING WHEN IT WAS FUN! | Image Central Drag Racing said
[…] Reading File names inside a folder in Adobe AIR « BTA Flexing […]
RuPaul’s Drag Race | Image Central Drag Racing said
[…] Reading File names inside a folder in Adobe AIR « BTA Flexing […]