Language: ChineseGermanSpanishFrenchDutchItalianRussian
123 Flash Chat Forums

Go Back   TOPCMM Community > SWFKit > SWFKit Support

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 03-24-2003, 01:29 AM
Senior Member
 
Join Date: Feb 2003
Posts: 212
Default example from help doesn't work

In your help files I stumbled upon this code to get a file list

//Initialize
//The following example illustrates how to get a Files collection and iterate the collection
//using the Enumerator object and the for statement:
function ShowFolderFileList(folderspec)
{
var fso, f, f1, fc, s;
fso = new ActiveXObject("Scripting.FileSystemObject");
f = fso.GetFolder(folderspec);
fc = new Enumerator(f.Files);
s = "";
for (; !fc.atEnd(); fc.moveNext())
{
s += fc.Item();
s += "<br>";
}
return(s);
}
var fso = new ActiveXObject("Scripting.FileSystemObject");
var a = fso.CreateTextFile("c:\\testfile.html", true);
a.writeLn(ShowFolderFileList("c:\\"));
a.Close;
return true;


But when I run the example I get this error

Warning: unknown method "Item"
Warning: unknown method "Item"
Warning: unknown method "Item"
Warning: unknown method "Item"
Warning: unknown method "Item"
Warning: unknown method "writeLn"


What is wrong??
Reply With Quote
  #2 (permalink)  
Old 03-28-2003, 07:42 AM
Senior Member
 
Join Date: Dec 2002
Posts: 2,015
Default Re: example from help doesn't work

Hi meester, sorry for the late response.

FFish Script is a case sensitive language. You should spell "fc.item()" instead of "fc.Item()"

"writeln" is not a method of "TextStream" object, it should be "writeline".

Reply With Quote
  #3 (permalink)  
Old 03-31-2003, 12:57 AM
Senior Member
 
Join Date: Feb 2003
Posts: 212
Default Re: example from help doesn't work

two questions

-I still don't seem to get a list of all the files in the directory.
All I get is a testfile like

[activeX Object]
[activeX Object]
[activeX Object]
[activeX Object]
[activeX Object]
...


- Is there a way to call a function in flash through Ffisch?
Reply With Quote
  #4 (permalink)  
Old 04-01-2003, 06:27 AM
Senior Member
 
Join Date: Jan 2001
Posts: 413
Default Re: example from help doesn't work

Yes, "fc.Item()" is an object, change it to "fc.Item().name" , you may get what you want,

Code:
s += (fc.Item()).name;
Reply With Quote
Reply

Was this information helpful?    Yes No



Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 06:24 AM.


Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.1.0 ©2007, Crawlability, Inc.