What I do is to use xml.  I wrap all of my return server data in a status
node, like this successful login:

<callstatus status="success" statusDescription="User authenticated" >

  <userInfo first="John" last="Smith" email...@gmail.com ./>

</callstatus>

 

If the login fails, I return:


<callstatus status="fail" statusDescription="credentials are not valid" />

 

In the handler I do:

var xmlResult:XML = XML(event.result);  //musy have resultFormat="e4x"

if (xmlresu...@status == "success") {

            UserInfo.first = xmlresult.userin...@first;

            .

}

else  {

  Alert.show("Login Failed: " +xmlresu...@statusdescription )

}

 

 

 

Tracy Spratt,

Lariat Services, development services available

  _____  

From: flexcoders@yahoogroups.com [mailto:flexcod...@yahoogroups.com] On
Behalf Of stinasius
Sent: Friday, March 13, 2009 2:17 AM
To: flexcoders@yahoogroups.com
Subject: [flexcoders] Re: storing login data from a cfquery for use throught
flex app

 

hi, may be i will try to put the question this way, in my cfc i have to
return a Boolean value "true or false" because in my result handler on the
login page i test to see if the result returned is true or false then make a
decision to accept login or not. this is my result handler on the login page

private function login_result(event:ResultEvent):void
{
// login successful, remember the user.
if( event.result == "true" || event.result == "TRUE" || event.result == "1"
|| event.result == 1 )
{ 

this.dispatchEvent( new Event('loginSuccessful') );
}
else
{
// login didn't work. show message
errorMessage("Login unsuccessful"); 
}
} 
but if i set the cfc to return a query result in this case
"checkAuthentication" nothing happens. so is there a way of returning a
query result and have the result handler check against the returned result
in order to make a decision to authenticate or not?



Reply via email to