Skip navigation
vaibhavvp23
Currently Being Moderated

Writing to XML

Aug 1, 2011 6:00 AM

I am trying to update value of a xml node. below is the code -

 

 

      <fx:Declarations>

            <s:HTTPService id="srv" url="comVars/userInfo.xml"/>

      </fx:Declarations>

     

      <fx:Script>

            <![CDATA[

                 

                  import flash.net.*;

                  public var userInfo:XML;

                  public var url:URLRequest;

                  public var loader:URLLoader;

                 

                  public function skipPwd():void{

                        url = new URLRequest("comVars/userInfo.xml");

                        loader = new URLLoader(url);

                        loader.addEventListener(Event.COMPLETE, skipPwd2);                     

                  }

                 

                  public function skipPwd2(event:Event):void{

                        if(loader.data){

                              userInfo = XML(loader.data);

                        }

                        userInfo.replace("pwdSet", <pwdSet>Skip</pwdSet>);

                  }                

            ]]>

      </fx:Script>

 

                <s:Button x="642" y="283" label="Skip Pwd" click="skipPwd()"/>

 

 

Can someone tell me whats going wrong here? Or i need to approch another way?

 

Thanks,

Vaibhav

 

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points