var my_xml:XML = new XML();
my_xml.appendChild( my_xml.createElement("ChooseOption") );
my_xml.firstChild.appendChild( my_xml.createElement("ques") );
my_xml.firstChild.firstChild.attributes.id="1";
my_xml.firstChild.firstChild.attributes.agegrp="1";
my_xml.firstChild.firstChild.attributes.level="1";
my_xml.firstChild.firstChild.appendChild( my_xml.createElement("questxt") );
my_xml.firstChild.firstChild.firstChild.attributes.ans="1";
my_xml.firstChild.firstChild.childNodes[0].appendChild(
my_xml.createTextNode("Drive Me!"));
my_xml.firstChild.firstChild.appendChild( my_xml.createElement("opt1") );
my_xml.firstChild.firstChild.childNodes[1].appendChild(
my_xml.createTextNode("Out Patient Department"));
my_xml.firstChild.firstChild.appendChild( my_xml.createElement("opt2") );
my_xml.firstChild.firstChild.childNodes[2].appendChild(
my_xml.createTextNode("Other Patient Department"));
my_xml.firstChild.firstChild.appendChild( my_xml.createElement("opt3") );
my_xml.firstChild.firstChild.childNodes[3].appendChild(
my_xml.createTextNode("Original Patient Department"));
trace(my_xml.toString());
This creates a XML node structure in Flash.
For More Refer:
http://www.kirupa.com/developer/actionscript/create_edit_xml.htm
No comments:
Post a Comment