1 Reply Latest reply on Dec 11, 2006 4:54 PM by JellyJulie

    XML/Flash

    names_ago_go
      trying to get data from form in flash to xml file, the element and node ref's are correct and the send() has the correct parameters. I don't know ,aybe the xml file is incorrect..have been staring at it for too long!..any ideas?

      actionscript below:

      var myArray:Array= new Array;

      var XMLPath:String= "input.xml"
      var my_xml:XML = new XML();
      my_xml.ignoreWhite = true;
      my_xml.contentType = "text/xml";

      my_xml.onLoad=function(success){

      if (success) {
      my_xml.firstChild.childNodes[0].childNodes[0].childNodes[0].nodeValue=mId_txt.text;
      my_xml.firstChild.childNodes[0].childNodes[1].childNodes[0].nodeValue=fn_txt.text;
      my_xml.firstChild.childNodes[0].childNodes[2].childNodes[0].nodeValue=ln_txt.text;
      my_xml.firstChild.childNodes[0].childNodes[3].childNodes[0].nodeValue=hc_txt.text;
      }

      }

      btn.onPress=function(){
      my_xml.send(XMLPath,"_blank");
      }


      xml below:

      <?xml version='1.0'?>
      <members>
      <member>

      <id> </id>
      <fn> </fn>
      <ln> </ln>
      <hc> </hc>

      </member>
      </members>
        • 1. Re: XML/Flash
          JellyJulie
          not that I know very much about this, but shouldn't it be:

          my_xml.firstChild.childNodes[0].childNodes[0].firstChild.nodeValue=mId_txt.text;

          to get to the <id> tag (firstChild instead of childNodes?)

          you also named the first text field different than the others that follow
          mId_text, while the other ones have the same prefix as the XML, you might want to check if you named it correctly

          Good Luck
          Julie