# New XML

**URL:** <https://forum.kirupa.com/t/new-xml/25112>\
**Category:** programming\
**Created:** [July 9, 2003, 4:33pm UTC](https://forum.kirupa.com/t/new-xml/25112 "2003-07-09T16:33:26Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![QBA](https://avatars.discourse-cdn.com/v4/letter/q/e0b2c6/32.png) [@QBA](https://forum.kirupa.com/u/QBA)\
**Post date:** [July 9, 2003, 4:33pm UTC](https://forum.kirupa.com/t/new-xml/25112/1 "2003-07-09T16:33:26Z")

</div>

Hi

I’m trying to create a form in flash that create a XML file that will be use by a server, I have the input text boxes with variables created already but I’m having trouble having flash to create the XML file ☹

This is the script I’m using on the submit button of the movie, I tried putting this script on the first frame and is not working either:

on (release) {

myXML = new XML();  
myXML.ignoreWhite = true;

//Creating the root element  
myRoot = myXML.createElement(“HEADING”);  
myXML.appendChild(myRoot);

addElement(myRoot, “USERNAME”, txtUserName);  
addElement(myRoot, “PASSWORD”, txtPassWord);  
addElement(myRoot, “FIRSTNAME”, txtFirstName);  
addElement(myRoot, “LASTNAME”, txtLastName);  
addElement(myRoot, “DRNUMBER”, txtDrNumber);  
addElement(myRoot, “SPECIALTY”, txtSpecialty);  
addElement(myRoot, “POSTALCODE”, txtPostalCode);  
addElement(myRoot, “SPECIALTY”, txtSpecialty);  
addElement(myRoot, “EMAIL”, txtEmail);

function addElement(parentElement, elementName, textNodeValue) {

```
//Creating the Username element
myElement = parentElement.createElement(elementName);

//creating the username text node
myTextNode = parentElement.createTextNode(textNodeValue);

//Associting the textNode to the textElement
myElement.appendChild(myTextNode);

//Adding the element to the myDoctorXML
parentElement.appendChild(myElement);

```

}  
}

I’m runing this script but I can’t get flash to created a XML file after I intup text in each text field ☹

Can some one help out to get flash MX to create the XML file?

THANKS !!!

Alex 🙂
