0 Replies Latest reply on Apr 25, 2007 8:08 AM by Atmospherian

    accessing web service last result from click handler

      im using the following basic setup:

      <mx:WebService id="ws" wsdl="">
      <mx:operation name="AuthenticateUser"/>

      import flash.events.MouseEvent;
      import mx.controls.Alert;

      private function loginButtonClickHandler(event: MouseEvent):void
      var result:String = "";

      //Alert.show(username.text + " " + password.text);
      ws.AuthenticateUser(username.text, password.text);

      if (ws.AuthenticateUser.lastResult == "authenticated") {

      <mx:TextInput x="108" y="363" id="username"/>
      <mx:TextInput x="108" y="401" id="password" displayAsPassword="true"/>
      <mx:Button x="108" y="438" label="Button" id="login" click="loginButtonClickHandler(event);"/>
      <mx:Label x="108" y="485" text="{ws.AuthenticateUser.lastResult}" id="resulttxt" color="#ffffff"/>

      the alert box in the click handler is only fired after the second time i click the button. what do i need to do to ensure that it would fire on the first click?

      this is just a test for a much more complicated process that would ensue once the user is authenticated, but i just want to get the basic functionality working. thanks