Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

server input

Status
Not open for further replies.

stormbind

Technical User
Mar 6, 2003
1,165
GB
Hi,

What would be the cleanest way to get information about a the web server's directory structure into Flash?

Thanks

--Glen :)

Memoria mihi benigna erit qui eam perscribam
 
Possibly, but server or script will produce a text output.

What is the best way to read that text into Flash?

--Glen :)

Memoria mihi benigna erit qui eam perscribam
 
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");
}

}
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top