Posted By

shakrdesign on 05/20/09


Tagged

textmate xml


Versions (?)

Who likes this?

1 person have marked this snippet as a favorite

LeeRJohnson


load xml


 / Published in: ActionScript 3
 

  1. var loader:URLLoader = new URLLoader();
  2. var xmlData:XML = new XML();
  3. loader.addEventListener(Event.COMPLETE, loadXML);
  4.  
  5. loader.load(new URLRequest("xml url"));
  6.  
  7. function ParseXML(xmlName:XML):void {
  8. var xmlListName:XMLList = xmlName.nodeName;
  9.  
  10. for each (var xmlElement:XML in xmlListName) {
  11. trace(xmlElement.attribute("attributeName"));
  12. }
  13.  
  14. }
  15.  
  16. function loadXML(e:Event):void {
  17. xmlData = new XML(e.target.data);
  18. ParseXML(xmlData);
  19. }

Report this snippet  

You need to login to post a comment.