Question
Directory listing SSAS
Hey Adobe Forums,
I'm working on a project for a university and I need help. I need the main.asc file to return the current directory listing to a flash application.
Main.asc file:
application.onConnect = function( p_client)
{
....
p_client.call("dirRcv", null, getDirectory("/"));
}
function getDirectory (theDirectory) {
var currentDir = new File(theDirectory);
var a = currentDir.list(function(name){return name;});
return a;
}
Tracing a in main.asc returns the correct listing.
Client class:
public function dirRcv(d:Object):void {
trace(d);
for (var a in d)
{
trace(a);
}
}
This returns:
[object Object],[object Object],[object Object]
0
1
2for (var part in d)
{
trace(part + ": " + d[part]);
}
returns
responds with
0: [object Object]
1: [object Object]
2: [object Object]
and appending .toString after d[part] returns
0: function Function() {}
1: function Function() {}
2: function Function() {}
Any help is appreciated, thanks.
