1 Reply Latest reply on Jan 31, 2008 10:33 AM by xmousex

    manipulate the xml while its in flash.

    xmousex
      button_xml.firstChild.childNodes[this.id].attributes.link=_root.buttonURL.text;

      my world would be blown away if the above line actually worked. Id probably never use arrays again for anything and just use xml to manage everything in all my movies ever. but childNodes is read only and for the most part anything i try to do to manipulate xml once its loaded in fails.

      if i load in xml that looks like this
      <buttonList>
      <button link="google.com"/>
      <button link="google.com"/>
      <button link="google.com"/>
      </buttonList>
      And in the flash movie i want to change the second node link="adobe.com". Action script doesnt have a way to just do that. The behavior so far XML() is all kinds of read only and doesnt let you edit directly. At the end of the session, I need this object to contain the manipulated version of the original flash i loaded up. Tutorials i have read never touch the original xml. Is it expected that if i want to change something in the original document I should create an entire clone from the beginning and include the changed value?
        • 1. Re: manipulate the xml while its in flash.
          xmousex Level 1
          so the answer is yeah you have to build a new xml document with your changes, but do it at the end when all your data changes are over with.. my solution is im going to spin all this xml into hashes, or what flash calls "literal array objects" uhh yeah whatever. Make your data changes in the hash format as you go along and when the session is over repackage the hash up into a new xml document. You can then send submit your xml document back to the server if you want to save your changes.