1 Reply Latest reply on Jul 18, 2007 7:16 AM by Gorka Ludlow

    modify xml attribute

    abcdcba
      Hi
      I would like to modify an xml file from flash. How can I do this?
      The xml looks something like this:

      <options
      scroll_arrow_width="4"
      scroll_arrow_height="4.5"
      click_screen_navigate="true"
      />

      Well, the file is a little longer, but the structure the same, there are attributes, that I want to modify.
      This is what I've done so far in flash:

      myXml.load("setup.xml");
      myXml = new XML();
      myXml.ignoreWhite = true;
      myXml.onLoad = function ()
      {
      options = this.firstChild.attributes;
      trace(options.click_screen_navigate);
      }

      Flash can read the attribute, and shows that it is set to true, but now I must modify this. How can I do it?
      I tried several things, commands, but I'm very new to xml.
      Every time when I checked the xml file, nothing changed. Can I "really" write into an xml file with flash? Like I do it with the notepad?

      Can anyone help me with this???
      Thanks,
      Gabor
        • 1. Re: modify xml attribute
          Gorka Ludlow Level 1
          No, you can not write to an xml file via flash, but you can call a server side script (php, asp, jsp, etc) to modify the xml file. You'll have to pass the new value to the server side script to change it in the original file.

          Cheers,
          Gorka
          www.AquiGorka.com