New XML

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 :frowning:

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 :frowning:

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

THANKS !!!

Alex :slight_smile: