|
|||
|
I am trying to figure out how to return a list of files from a specific folder, and display that list in the listBox componenet, in flash.
I found the folder object in the help files, but there are no examples. I see that it returns a string array, but is there a way to break that string into a delineated list? Or and way to specify the delineator in the array string? I am doing this with flash studio PRO currently, but wanted to see if I could do it with SWFkit, because I am thinking about purchasing it. ??? |
|
|||
|
I sent you a sample to your mail box,please check it out,
the ffish script code: Code:
rootFolderStr = "d:\\";
slen = rootFolderStr.length;
rootFolder = new Folder(rootFolderStr);
rootSize = rootFolder.size;
var folders = rootFolder.subFolders;
ds = folders.length;
var subFolderSize = 0;
s = ((rootSize)/(1024*1024)).format("%.2f");
trace(rootFolder +": " + s + "M");
for (i = 0; i < ds; i ++)
{
* * *var subFolder = folders[i];
* * *var n = (new Folder(subFolder)).size;
* * *subFolderSize += n;
* * *s = (n/(1024*1024)).format("%.0f");
* * *subFolder = subFolder.substring(slen,subFolder.length);
* * *trace("test: " + subFolder + ": " + s + "M");
}
hopt it can help you! ![]() |
![]() |
Was this information helpful? Yes No
| Thread Tools | |
| Display Modes | |
|
|