1 Reply Latest reply on Jun 13, 2007 2:26 PM by ntsiii

    xml parse error (login system)

    ecstasylove
      Hi,

      Do you know how to stop this from causing a parse error?
      It's based on the login system tutorial here http://www.vipercreations.com/tutorials/Adobe%20Flex/28.html


      <mx:Script>
      <![CDATA[
      import mx.rpc.events.ResultEvent;

      ]]>
      </mx:Script>
      <mx:Script>


      <![CDATA[

      private function checkLogin(evt:ResultEvent):void
      {

      if(evt.result.loginsuccess == "yes")

      {

      currentState = "Logged In";

      }

      if(evt.result.loginsuccess == "no")

      {

      mx.controls.Alert.show('Invalid username/password');

      }
      }

      ]]>

      </mx:Script>


      <mx:HTTPService id="login_user" result="checkLogin(event)" showBusyCursor="true" method="POST" url=" http://www.vipercreations.com/site_admin/login.php" useProxy="false">
      <mx:request xmlns="">
      <username>
      {username.text}
      </username>
      <password>
      {password.text}
      </password>
      </mx:request>
      </mx:HTTPService>
        • 1. Re: xml parse error (login system)
          ntsiii Level 3
          Where is the error being thrown?

          What is the dataService returning?

          Are you aware that HTTPService defaults to resultFormat="object"? I advise resultFormat="e4x" if you have xml being returned.

          Are you sure username.text and password.text are non null?

          I also advise building the request object in AS code. It is easier to debug and catch errors.

          Tracy