I am creating an app that allows users to import books from the books directory on the Playbook (when you plug it in to the computer). How do I code this? Is there a class I can use in Adobe Flash Builder to access the file directories?

If you look at this image,

http://cdn.crackberry.com/files/u10880/IMG_00000031.jpg

you can see that I want to make something very similar to this, where a user can import all of the books from the books folder.

Thank you for all of your help!

有帮助吗?

解决方案

You can use FileFilter class to filter your search , Use File.browseToOpen() to get files according to your filter.

private  var audioFile : File = new File();
private var audioFilter:FileFilter =new FileFilter("files","*.mp3;","*.;"); 
audioFile.browseForOpen("Open", [audioFilter]);
audioFile.addEventListener(Event.SELECT, audiofileSelected);
private function audiofileSelected(event:Event):void
{
var myFile : File= File.documentsDirectory.resolvePath((event.target as File).name);
sourceAudioFile =(event.target as File);
}
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top