Reading Text Nodes and Their Values : XML Object « XML « Flash / Flex / ActionScript






Reading Text Nodes and Their Values

 

package{
  import flash.display.Sprite;
  
  public class Main extends Sprite{
    public function Main(){
        var book:XML = <book>
                         <title>ActionScript</title>
                       </book>;
        
        var title:String = book.title.toString(  );
        
        trace( title );
    }
  }
}

        








Related examples in the same category

1.Creating an XML Object
2.Create the XML structure with a string
3.Understanding the XML Classes
4.Using Expressions within Literals: embed ActionScript code directly into your XML data.
5.Adding Attributes to an XML Element
6.Reading Elements in an XML Tree
7.Finding Elements by Name