Hi I was just wondering if any one could help me out with
this, i am trying to create a user login sytem using the
HTTPService that passes username & email to the server and
returns the users details, from which i can then log them into the
flex system. I have managed to set up the sending of the data and
returning of the user data into a data grid, however when i try to
extract just one element from the returned XML data i cant seem to
move down the nodes my xml is returned in this format ::
<rss>
<channel>
<title>UserLogin</title>
<item>
<id>1</id>
<userLevel>1</userLevel>
</item>
</channel>
</rss>
Im trying to pass the userlevel data into a actionScript
variable is there anyway to do this?
And here is my MXML file::
<?xml version="1.0" encoding="utf-8"?>
<mx:VBox xmlns:mx="
http://www.adobe.com/2006/mxml"width="160"
horizontalAlign="center" cornerRadius="10"
borderStyle="solid" borderThickness="1"
backgroundColor="#c0c0c0" dropShadowEnabled="true" >
<mx:Script>
<![CDATA[
import mx.controls.Alert;
import mx.rpc.events.ResultEvent;
import mx.collections.ArrayCollection;
[Bindable]
private var loginData:ArrayCollection;
private function loginDataHandler(event:ResultEvent):void{
loginData = event.result.rss.channel.item;
}
]]>
</mx:Script>
<mx:HTTPService id="loginRequest" url="PHP/Login.php"
method="POST"
result="loginDataHandler(event)">
<mx:request>
<userName>{userName_txt.text}</userName><password>{password_txt.text}</password>
</mx:request>
</mx:HTTPService>
<mx:Label text="LOGIN"/>
<mx:TextInput id="userName_txt" width="140"
text="UserName"/>
<mx:TextInput width="140" id="password_txt"
text="Password" displayAsPassword="true"/>
<mx:Button label="Login" id="login_btn"
click="loginRequest.send()"/>
<mx:DataGrid id="loginAuth"
dataProvider="{loginRequest.lastResult.rss.channel.item}
" width="150" height="71">
</mx:DataGrid>
</mx:VBox>
If anyone can tell me how to pass variables from the returned
XML into actionsript that would be great as i can probably work it
out from there.
Absolutely any help or ideas would be great.
Thanks in advance