Hey Jason,
You don't say .nodeValue - the nodeValue is just the first item in the
Array. Technically, it's a String object.
Here is a sample class that parse that entire xml and traces it out.
In your timeline just put:
import com.Test;
var test:Test = new Test();
And you'll see it trace the test.xml file.
///////////////////////////////////////////////////////////////////////
import com.stevensacks.data.XML2AS;
import mx.utils.Delegate;
class com.Test
{
private var xml:XML;
function Test()
{
var d:Date = new Date();
var xmlPath:String = "test.xml";
load(xmlPath);
}
private function load(xmlPath:String):Void
{
xml = new XML();
xml.ignoreWhite = true;
xml.onLoad = Delegate.create(this, parseXML);
xml.load(xmlPath);
}
private function parseXML(success:Boolean):Void
{
if (success) {
var xmlObj:Object = {};
XML2AS.parse(xml.firstChild, xmlObj);
trace("test.foo = " +
xmlObj.config[0].test[0].attributes.foo);
var nodes:Array =
xmlObj.config[0].items[0].item;
var i:Number = nodes.length;
while (i--) {
trace(nodes[i]);
}
} else {
trace("XML Failed to load");
}
}
}
_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com