Hello,
I am creating a tool for use at the office. It has, at this point, about a dozen text fileds. From these textfields I want to build an XML document using AS. The way it needs to work is when a user enters text into these fields and hits the submit button that text is put into the propper tags. Each time the user hits the submit button another block of XML code is added to the file.
Here is most of the code. I am building this on another computer which is not online so I am only showing the important stuff here. It works so far but the only output I have seen is a trace. I could have the user manually copy and paste this output to the XML document but I would rather have the document built by the program each time the user hits the submit button. Am I even on the right track here? I have the correct output, now how do I add this output to an existing XML file? Thanks in advance.
function loadFile(){
var fileName:TextField = docName; //loading an existing XML file.
var loader:URLLoader = new URLLoader();
loader.addEventListener(Event.Complete, loadXML);
loader.load(newURLRequest(fileName.text));
function loadXML(e.Event):void{
var xml = new XML(e.target.data);
}
}
var quest:XML;
function buildNodes(){
quest = <question>
<name>
<text>{qName.text}</text>
</name>
</question>
}