I want to create an XML string in Flex 3 in a similar way to you might approach it in Java. I only want a small piece of XML in the format
<slide thumb="http://www.thumbs.com/thumb.jpg" type="static" blah="bleh" />
The only type of code I can find for doing this seems ridiculous....
private function createXML(): void
{
var xm:XML = <Relyon></Relyon>;
var nodeName:String = “EMPLOYEENAME”;
var nodeValue:String = “KUMAR”;
var xmlList:XMLList = XMLList(”<”+nodeName+”>”+nodeValue+”</”+nodeName+”>”);
xm.appendChild(xmlList);
Alert.show(xm);
}
I would like to do something like...
var x:XMLNode = new XMLNode("slide");
x.setAttribute("thumb", thumbURL);
x.setAttribute("type", "static");
This is surely possible?