# Need help adjusting tutorial script

**URL:** <https://forum.kirupa.com/t/need-help-adjusting-tutorial-script/255860>\
**Category:** Uncategorized\
**Created:** [March 27, 2008, 5:15pm UTC](https://forum.kirupa.com/t/need-help-adjusting-tutorial-script/255860 "2008-03-27T17:15:32Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![nondotzero](https://avatars.discourse-cdn.com/v4/letter/n/ecae2f/32.png) [@nondotzero](https://forum.kirupa.com/u/nondotzero)\
**Post date:** [March 27, 2008, 5:15pm UTC](https://forum.kirupa.com/t/need-help-adjusting-tutorial-script/255860/1 "2008-03-27T17:15:32Z")

</div>

A brief description of what i want to accomplish:

Ive got a swf file which contains 2 input text fields and an image selector, both the input text fields and the image selector return a value to a variable after inputting the information.

Now i want to write the information from those variables in a XML document (so i can later on read that xml data in another swf).

Since my knowledge from xml is near nothing, I’d hoped someone could quickly adapt this tutorial script for me.

======================================  
My XML file would be this:

# \<slide\> \<title\>Title goes here\</title\> \<contents\>Main contents text goes here\</contents\> \<background\>url to selected image goes here\</background\> \</slide\>

Script for writing to XML from tutorial which needs to be adapted: (I will use the simple\_save.php file from the tutorial)

var xml\_file = “readwrite/simple\_edit.xml”;  
var server\_file = “simple\_save.php”;

var input\_xml = new XML();  
input\_xml.ignoreWhite = true;  
input\_xml.contentType = “text/xml”;  
input\_xml.onLoad = function(success){  
if (success) input\_txt.text = this.firstChild.firstChild.nodeValue;  
else input\_txt.text = “Error loading input XML”;  
}

send\_btn.onRelease = function(){  
input\_xml.parseXML("\<edit\> new text \</edit\>");  
input\_xml.firstChild.firstChild.nodeValue = input\_txt.text;  
input\_xml.xmlDecl = “”; // declaration duplication bug  
input\_xml.sendAndLoad(server\_file, output\_xml);  
output\_txt.text = “Loading…”;  
}

Has to be adapted so that it writes the info from:  
-input\_title  
-input\_contents  
-input\_backgroundurl  
In the XML document as I specified it above.

Thanks a lot, I should be able to figure out how it works once I see the changes which have been made.

Regards
