Rebuild XML data


I am reading a XML file into Flash.

Creating Arrays from the Data.

Then, I am modifying these arrays.

And then, I want to recreate the XML again which will be sent to a server side script to update the origional XML on the server.

Can anyone suggest how to i do this? I dont know how to recreate the XML after the Arrays have been modified.
Any suggestion is welcome.

Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

negatyveConnect With a Mentor Commented:
ok, follow me:

• create a new xml file, named "test.xml"
• write inside it:

<?xml version="1.0" encoding="UTF-8" ?>

• create a flash movie in the same folder
• test this code:

data_xml = new XML();
data_xml.ignoreWhite = true;
data_xml.onLoad = function(success)
            // edit xml file
      } else {
            // xml file missing
            trace("XML FILE NOT FOUND");
function editXML(xml)
      // show source xml file in the output windo
      // create an empty array
      var temp_array = new Array();
      // select the items node sequence in the xml file
      var nodes = xml.firstChild.childNodes;
      for(var i = 0; i < nodes.length; i++){
            // push inside the array the numeric value of each item
      // show in the output window the filled array
      // add a value to each element (modify)
      for(var i = 0; i < temp_array.length; i++){
            temp_array[i] = temp_array[i] * 2;
      // show in the output window the modified array
      // create the new xml
      var new_xml = new XML('<?xml version="1.0" encoding="UTF-8" ?><data></data>');
      // add nodes
      for(var i = 0; i < temp_array.length; i++){
            // create the node
            var new_node = new_xml.createElement("item");
            // append inside it the corresponding array element as text
            // insert it in the new xml
      // trace the new xml
ssdesignAuthor Commented:
ok thats looks quiet ok, i will need to try it.

I will get back soon with my feedback wether it worked or not.

Just need to try it with my application.
That's ok, take your time.. :)
Take Control of Web Hosting For Your Clients

As a web developer or IT admin, successfully managing multiple client accounts can be challenging. In this webinar we will look at the tools provided by Media Temple and Plesk to make managing your clients’ hosting easier.

ssdesignAuthor Commented:
I have not forgotten, give me just one more day. Ok?
>I have not forgotten, give me just one more day. Ok?

hehe, that's right, no worries...
i know this is closed and all but that was a great answer.  to the original poster: feel lucky :D  information like that can be (is) expensive and rare.
All Courses

From novice to tech pro — start learning today.