1 Reply Latest reply on Oct 15, 2010 7:49 AM by John Malc

    Why do i get "no" in "login-form"

    John Malc

      <?xml version="1.0" encoding="utf-8"?>
      <s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
                     xmlns:s="library://ns.adobe.com/flex/spark"
                     xmlns:mx="library://ns.adobe.com/flex/mx" minWidth="955" minHeight="600">
          <fx:Script>
              <![CDATA[
                  import mx.rpc.events.ResultEvent;
              ]]>
          </fx:Script>
          <fx:Script>
              <![CDATA[
                  import mx.controls.Alert;
                  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');
                         
                      }       
                  }
              ]]>
          </fx:Script>
          <fx:Declarations>
          <mx:HTTPService id="login_user" showBusyCursor="true" result="checkLogin(event)" method="POST" url="http://www.komentovaneudalosti.cz/flex/login.php" useProxy="false">
              <mx:request xmlns="">
                  <username>
                      {username.text}
                  </username>
                  <password>
                      {password.text}
                  </password>
              </mx:request>
          </mx:HTTPService>
          </fx:Declarations>
          <s:Panel width="250" height="200" id="cely_panel" horizontalCenter="-33" verticalCenter="-43" textAlign="center" title="Prihlas se" backgroundColor="#003862">
              <s:BorderContainer width="204" height="148" x="30" y="10" id="vnitrni_panel" backgroundColor="#AD159D">
                  <s:Label x="10" y="53" text="username&#xd;" id="username"/>
                  <s:Label x="10" y="84" text="password&#xd;" id="password"/>
                  <s:TextInput x="76" y="47" width="94" id="username_zadat"/>
                  <s:TextInput x="77" y="80" width="94" height="22" id="password_zadat" displayAsPassword="true"/>
                  <s:Button y="115" label="Submit" id="submit" horizontalCenter="-1" click="login_user.send();"/>
              </s:BorderContainer>
          </s:Panel>
      </s:Application>

      Hi, Fist of all i am the beginner of flex SDK and FB and this schould be the first "application" for my test reasons. So when i upload the all "bin-debug\" files on my server i get the error "no". Just this. Why do i get this? , because FB doesn't show me any "errors" which i should correct. And also FB shows me the complett application right, i mean without "no-error".

      Maybe something is wrong, because of this line ????

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

      Please can you help me to solve this problem.