1 Reply Latest reply on Sep 25, 2006 7:58 AM by knallore_adobe

    HTTPService send and retrieve data

    Riddick_X
      Im trying to build a small application that allow user to login into the app (based on user id and pass from a database) and dysplaye all relative data in a datagrid. The problem is: how can i check if user exist on database? Sending data work and called script works but i dont understend how to catch a negative response like "user non found ". Her code i use:

      <mx:Panel xmlns:mx=" http://www.adobe.com/2006/mxml" layout="absolute" width="300" height="170" title="Login Utente">

      <mx:HTTPService id="srv" url=" http://localhost/xxxxxx/xxxxxx.asp"
      method="POST"
      resultFormat="text">
      <mx:request>
      <Username>{txtUsername.text}</Username>
      <Password>{txtPassword.text}</Password>
      </mx:request>
      </mx:HTTPService>

      <mx:Form y="0" height="130" width="280" x="0">
      <mx:FormItem label="Username" required="true">
      <mx:TextInput maxChars="10" id="txtUsername"/>
      </mx:FormItem>
      <mx:FormItem label="Password" required="true">
      <mx:TextInput displayAsPassword="true" maxChars="10" id="txtPassword"/>
      </mx:FormItem>
      <mx:FormItem>
      <mx:Button label="Login" click="srv.send()"/>
      </mx:FormItem>
      <mx:TextArea text="Prova" id="txtprova"/>
      </mx:Form>

      </mx:Panel>



      thanxs in advance.