Posted by Digisoul in SWF Studio V3 on May 28 2008, 07:34 pm

hi, plz can any1 explain how can i load a return string of filelist command in a list component or in data grid component...?? and plzzzzzzzzzzzzzzzzz if you hav any example write it or attach fla..


Posted by pompeyd in SWF Studio V3 on May 29 2008, 09:46 am

Hi digisoul,

Tim has shown you how to convert the result into an array in his reply to your post in the Wish List section.

Once you have done that, you need to cycle through the array in a for() loop, and then add each item to your List or DataGrid component. Check for addItem, or addItemAt in the flash help docs for those components.

HTH

Paul


Posted by AGo in SWF Studio V3 on May 29 2008, 11:15 am

you could have that even easier, simpy assign the array you got from split() as yourlistcomponent.dataProvider.

if you use a datagrid the elements of an datagrid.dataProvider are expected to be objects, with the column headers as the objects properties name. However IIRC that works with plain strings in the array as well.


Posted by pompeyd in SWF Studio V3 on May 29 2008, 11:35 am

Doh, AGo is correct. I had been working with FTP.getDirList where you get back more than just the filename, so I was thinking along the lines that the label field or column data would need to be pulled out of the array with each cycle of the for() loop.

Thanks for the correction AGo :)

Paul


Posted by Digisoul in SWF Studio V3 on May 29 2008, 04:45 pm

Thanks Guys for replying. For me, the main problem is i was using MDM ZINC, now i really wish to switch on SWF STUDIO. so thatz y you can say im new in S.S, well i tried the code like this
var r = ssCore.FileSys.dirList({path:"startdir://"});
var a:Array = r.result.split("|");

_root.fldrList.dataProvider = a;
but its did'nt work..? can you plz explain me in code ?


Posted by AGo in SWF Studio V3 on May 29 2008, 06:19 pm


QUOTE: from Digisoul;44463
Thanks Guys for replying. For me, the main problem is i was using MDM ZINC

I would not call that a problem but a showstopper bug, good you switched ;)

you probably have not enabled synchronous commands, so here is some stuff you should read:

first start with the introduction to the SWF Studio API (it is pretty different then Zinc´s but way more flexible, especially in terms of debugging and error detection), especially about the return object. Then go over to the FAQ about sync commands, which is what makes you struggling atm.

Finaly, don´t forget to add "ssCore.init()" as first command in your SWF (like mdm.init but without the bugs that come with it ;) ) and enable the FileSys plugin on the Plugins tab and you should be good to go.

hth


Posted by Digisoul in SWF Studio V3 on May 30 2008, 06:11 pm

I already read that stuff. and i used it in ma project. the only prob is "List"!
nothing else. ma project some type of Anti Virus thatz y i need to know the file list's advance use.


Posted by AGo in SWF Studio V3 on May 31 2008, 04:38 am

so if you have enabled sync commands, and enabled debug mode on the swf studio output tab, what do you get from r.Error.description ?


Posted by Digisoul in SWF Studio V3 on May 31 2008, 05:20 pm


QUOTE: from AGo;44476
so if you have enabled sync commands, and enabled debug mode on the swf studio output tab, what do you get from r.Error.description ?

It Gives the required files in Debug Window, But not ADD them in list. this is ma problem, i used the code, which i post already.