// assign BrokerID
this.BrokerID = event.resut.UserInfo.BrokerID;

You spelled result wrong.
--- In [email protected], "flycl65" <[EMAIL PROTECTED]> wrote:
>
> Trying to do a simple login via CFC.  Query SQL db and return a field
> value (BrokerID).
> 
> Returning the following error:
> ReferenceError: Error #1069: Property resut not found on
> mx.rpc.events.ResultEvent and there is no default value.
> 
> I tried doing it by returning the query and couldn't get it to work,
> and now tried a structure.  Help. ??????????
> 
> 
> <cffunction name="login" access="remote">
>       <!-- make sure we have username and password -->
>       <cfargument name="username" required="true" type="string" />
>       <cfargument name="password" required="true" type="string" />
>       <cfquery name="getUser" datasource="dentalsales">
>               SELECT *
>               FROM Users
>               WHERE Logon = '#arguments.username#'
>                       AND password = '#arguments.password#'
>       </cfquery>
>       
>       <!-- if username and password are correct -->
>       <cfif getUser.recordCount eq 1>
>               <cfset userInfo = structNew()>
>               <cfset userInfo.isLoggedIn = "true">
>               <cfset userInfo.username = getUser.logon>
>               <cfset userInfo.BrokerID = getUser.BrokerID>
>       <cfreturn userInfo />
>       </cfif>                         
> 
>
----------------------------------------------------------------------------------
> 
>             private function login_result(event: Object):void
>             {
>                                                       
> 
>               // login successful, remember the user.
>               if( (event.result) )
>               {
>                                       // assign BrokerID
>                                       this.BrokerID = 
> event.resut.UserInfo.BrokerID;
>                                       trace(BrokerID);
>                                       
>                       if( this.rememberLogin.selected )
>                       {
>                               this.lso.data['username'] = this.username.text;
>                               this.lso.data['password'] = this.password.text; 
>                       }
>                       else
>                       {
>                               this.lso.data['username'] = null;
>                               this.lso.data['password'] = null;               
>                       }
>                                       
>                                   this.dispatchEvent( new 
> Event('loginSuccessful') );
>               }
>               else
>               {
>                       // login didn't work. show message
>                       errorMessage("Login unsuccessful");     
>               }
>             }
> 
> 
> </cffunction>
>






--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to