Converting Strings to XML : XML variable : XML Flash / Flex / ActionScript examples


Flash / Flex / ActionScript examples » XML » XML variable »

 

Converting Strings to XML


 


package{
  import flash.display.Sprite;
  
  public class Main extends Sprite{
    public function Main(){
        var dialog:String = "Lorem ipsum dolor sit amet";
        var XMLString:String = "<dialog>" + dialog + "</dialog>";
        var xml:XML = XML(XMLString);
        trace(xml.text())// Displays: Lorem ipsum dolor sit amet


    }
  }
}

        



Leave a Comment / Note


 
Verification is used to prevent unwanted posts (spam). .


Flash / Flex / ActionScript examples

 Navioo XML
» XML variable