0 Replies Latest reply on Apr 24, 2007 12:42 PM by Mongolian Beef

    iterating over WS result is backwards

    Mongolian Beef Level 1
      I'm iterating over an XMLList returned from a Web Service. The returned document as well as a code snippet looks like this:

      <book id="0"/>
      <book id="1"/>
      <book id="2"/>

      var books:XMLList = soapService.createBooks.lastResult.books;

      for( var i:int = 0; i < books.length(); i++) {
      Alert.show("book id = " + books );

      when I try to iterate over books shown above, I would expect that the first node would be the book with id=0, the next with id=1, and so forth. However, the alert boxes are in reverse, i.e. id=2 shows up first, then id=1and lastly id=0. Why is everything in reverse? thanks in advance.