Login und Changestate funktioniert nicht [Flash 10]
| Beiträge: 43 Registriert: Apr 2009
| 25.04.2011, 13:45
Grüße euch,
hab wieder mal ein kleineres Problem mit meinem Flashbuilder
Ich habe eine Anmeldemaske um sich einzuloggen erstellt, aber es passiert nichts.
PHP:1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
|
<![CDATA[
import mx.controls.Alert;
protected function login_btn_clickHandler(event:MouseEvent):void
{
//login send Parameters
loginService.send();
//login parameters
if (loginService.lastResult.result == 0)
{
mx.controls.Alert.show("Authentifizierung erfolgreich");
this.currentState="Intern";
}
else {
mx.controls.Alert.show("Authentifizierung fehlgeschlagen");
}
}
]]>
</fx:Script>
<fx:Declarations>
<s:HTTPService id="loginService" url="http://www.seumes-letzter-kader.de/Login/login.php" method="POST" showBusyCursor="true">
<s:request xmlns="">
<username>
{usernameField.text}
</username>
<password>
{passwordField.text}
</password>
</s:request>
</s:HTTPService>
</fx:Declarations>
<s:TextInput x="173.7" y="44.45" id="usernameField"/>
<s:TextInput x="173.4" y="72.5" id="passwordField"/>
|
Dia passende PHP-Datei :
PHP:1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
|
if ( $_POST['username'] == "admin" && $_POST['password'] = "password") {
// First part tells Flash that the data is in fact XML.
//Second part <result> contains the data.
$result = '<?xml version="1.0" encoding="UTF-8" ?><result>0</result>';
} else {
//Same for here.
$result = '<?xml version="1.0" encoding="UTF-8" ?><result>1</result>';
};
//Prints the completed XML on the page for flex to read.
print $result;
|
Wenn ich die Daten eingebe erscheint zwar der busy-Cursor, aber es will nichts passieren. Ich bekomme auch keinen alert. Der State soll sich dann auch wechseln, aer da passiert auch nichts.
Ich kann den Fehler nicht finden. Habt ihr vllt eine Idee ? | | | Beiträge: 579 Wohnort: Halle Registriert: Apr 2005
| 25.04.2011, 18:27
|
|