View Full Version : FLfile.listFolder Difficulties...
Script_Newbie
04-26-2007, 05:13 PM
This seems so easy but I've waisted a day trying to get it to work. I want to create an array that contains the file contents of a folder on my computer. Here's my code:
var fileList = new Array();
var folderURI = "file:///c|/temp";
var fileList = FLfile.listFolder(folderURI,"files");
var varText = fileList[0];
I test this by placing the variable varText into a text box on stage. It always comes up "Undefined". I've even tried fileList.length, which comes up "Undefined" as well. I assume it is the FLfile.listFolder line, but for the life of me I can't figure out what's wrong.
Any ideas?
slopps
05-01-2007, 03:56 PM
Your code seems to work ok for me.
Try changing your fileURI. The only way I was able to replicate your error was by giving it an incorrect fileURI, so I'm guessing it might be the path you're using.
Script_Newbie
05-02-2007, 06:43 PM
Thank you for the reply Slopps!
I have some questions for you. Were you able to get FLfile.listFolder to work in an .exe or .swf file and not just in the Flash authoring environment? Can you please post your code that you got to work? I'll create a folder structure that matches your fileURI and work back from there.
With your help, maybe I'll get this to work!
slopps
05-03-2007, 04:35 PM
Thank you for the reply Slopps!
I have some questions for you. Were you able to get FLfile.listFolder to work in an .exe or .swf file and not just in the Flash authoring environment? Can you please post your code that you got to work? I'll create a folder structure that matches your fileURI and work back from there.
With your help, maybe I'll get this to work!
Well, unfortunately you can't use JSFL commands in an exe, as the code that executes is solely for the purposes of the flash authoring environment. And the only way you can use them in a swf is if your trying to design a panel for use in the flash IDE.
I literally copy / pasted your code into senocular's command prompt and ran it within the flash IDE to test, and it worked fine. I'm working on a mac, so my file URI would be different from yours anyway...
I would set up a folder directly on the c:\, such as c:\FlashTest so you can easily test it out.
If you don't have senocular's command prompt, it's great tool for quickly testing out JSFL code in the Flash environment. You can grab it here:
http://senocular.com/flash/extensions.php?id=0.1
|
vBulletin® v3.8.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.