Thanks, I'll try out your sample and expand on that.  BTW, why did you
throw in the Date object - were you going to use that to append to the
XML path string as a cache buster?  I see you declared it, but didn't
use it again.

Jason Merrill
Bank of America  
Global Technology & Operations
Learning & Leadership Development 
eTools & Multimedia Team


 

>>-----Original Message-----
>>From: [EMAIL PROTECTED] 
>>[mailto:[EMAIL PROTECTED] On Behalf 
>>Of Steven Sacks | BLITZ
>>Sent: Friday, March 16, 2007 1:58 PM
>>To: [email protected]
>>Subject: RE: [Flashcoders] xml parse question - Steve Sacks
>>
>>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
>>
_______________________________________________
[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

Reply via email to