|
Prev: Locz not working
Next: Actual Tempo won't update...
From: korkster911 on 24 Jun 2008 18:56 Is there any way to create a file browser with Director? Basically, a single folder on the users drive will contain various files... Director reads the folder, adds the filenames to its interface as a list. User clicks one (A PDF for example) and the file opens. Any Ideas?
From: Sean Wilson on 24 Jun 2008 19:25 So what is it you want - some way of obtaining a list of all files in a folder, or a "browse" dialog? Director's getNthFilenameInFolder() and FileIO's displayOpen() will do this, as will Buddy API - with Buddy's commands being more complete and feature-rich.
From: korkster911 on 25 Jun 2008 09:06 Thanks for the response Sean. I'll look into the suggestions you made. I'm actually dealing with an original Flash based client project. At the 11th hour they realized "I can't pull dynamic files off the drive with Flash." In order to integrate the solution, I'll use Director to index the folders upon load and write an xml file to the drive. Then I'll use Flash to read the file and use a flash/Director behaviour to open the documents" Thanks!
From: Lukewig on 26 Jun 2008 07:39 Hi, If you download the "One Sprite Demo' from http://www.lingoworkshop.com/Codelib/OSW/Downloads.php, look for a file in there called "TreeDemo_filebrowser.dir". Basically its demonstrating how to use the treeview widget. You could make it into a functioning filebrowser by changing the following line from -- example of changing the label myNodeTreeRef.SetNodeValue("Opening...", args.path ) change to.... -- open the selected file using BuddyAPI res= baOpenFile(pathToOpen, "Normal") if (res <> 0) then alert ("error " & res & " opening file") There's probably a few other things you might want to do (filter the file list, provide a different starting directory etc - but it might be a start) -- Luke
|
Pages: 1 Prev: Locz not working Next: Actual Tempo won't update... |