The obvious choice for formatting info about a directory structure would be XML , call the server side script from flash, and have the script return the data to your flash movie as XML.
Use the XML class to manipulate that data once its been loaded
eg
var tree_xml:XML = new XML();
tree_xml.ignoreWhite = true;
tree_xml.load("
tree_xml.onLoad = processXML;
function processXML(loaded) {
if (loaded) {
// start manipulating the data
var root_node:XMLNode = tree_xml.firstChild;
var num = root_node.childNodes.length;
// loop through each node and do something with the data
for(var i=0; i<num; i++) {
// for example
trace(root_node.childNodes
.attributes.directoryName);
}
} else {
// something went wrong
trace("error loading xml");
}
}