Creating an XML Object : XML Object « XML « Flash / Flex / ActionScript






Creating an XML Object

 
package{
  import flash.display.Sprite;
  
  public class Main extends Sprite{
    public function Main(){
        var example:XML = <abc><a>eh</a><b>bee</b><c>see</c></abc>;
        var username:String = "Darron";
        var score:int = 1000;
        
        var example:XML = <gamescore>
                             <username>{username}</username>
                             <score>{score}</score>
                          </gamescore>;

    }
  }
}

        








Related examples in the same category

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