Create Date object from xml data : loop through « XML « Flash / Flex / ActionScript






Create Date object from xml data

 


package{
  import flash.display.Sprite;
  
  public class Main extends Sprite{
    public function Main(){


        var loan:XML = <LOAN>
          <BOOK ISBN="0000000000" DUE="1136091600000">
            <TITLE>ActionScript</TITLE>
            <AUTHOR>J, J</AUTHOR>
            <PUBLISHER>Books Ltd</PUBLISHER>
          </BOOK>
        </LOAN>;
        
        
        for each (var due:XML in loan..@DUE) {
          trace(new Date(Number(due)));
        }
    }
  }
}

        








Related examples in the same category

1.Processing XML with for-each-in and for-in
2.Use for loop to go through the xml data
3.Accessing Descendants
4.Use for each loop to access the attributes
5.Iterating through the Children of an Element
6.Use the for..in or for each..in statements to iterate through an XMLList.
7.Tree traversal: converts every element and attribute name to lowercase: