![]() |
|
|
![]() |
|
Thread Tools | Rate Thread |
![]() |
PM User | #1 |
New Coder ![]() Join Date: Jul 2009
Location: Odense, Denmark
Posts: 57
Thanks: 3
Thanked 0 Times in 0 Posts
![]() |
Flash builder and MySQL - string comparison
Okay so I watched this tutorial on how to make a simple Android App using Adobe Flash Builder (4.5).
It basically fires a php-script, sending post-vars, which then does some database checks, and if everything is alright, it echoes "1", else "0". The app is then supposed to do something depending on whether it echoes 1 or 0. Here's the output-bit of the php-file: PHP Code:
![]() Here's the important actionscript: Code:
import com.adobe.crypto.MD5; import com.adobe.crypto.SHA1; import com.adobe.crypto.SHA256; protected function button1_clickHandler(event:MouseEvent):void { var l:URLLoader = new URLLoader(); var r:URLRequest = new URLRequest("path/to/file.php"); var vars:URLVariables = new URLVariables(); vars.username = username.text; vars.password = ********password********; r.method = URLRequestMethod.POST; r.data = vars; l.addEventListener(Event.COMPLETE, lComplete); l.addEventListener(IOErrorEvent.IO_ERROR, lError); l.load(r); } protected function lComplete(event:Event):void { if(event.target.data == '1'){ navigator.pushView(views.Main); } else { trace(event.target.data); } } protected function lError(event:IOErrorEvent):void { trace('url error'); } Now, when I run the program and give it the appropriate values, it won't do the navigator.pushView(views.Main); thing. It just traces " 1 " (with spaces). And I can't figure out why. Can somebody help me with this? //Deafdigit
__________________
HornskovVindberg inkasso |
![]() |
![]() |
![]() |
Bookmarks |
Thread Tools | |
Rate This Thread | |
|
|