Wish it was that easy, changed the spelling and it
still doesn't work
but now a different error.
TypeError: Error #1009: Cannot access a property or method of a null
object reference.
--- In [EMAIL PROTECTED]ups.com,
"Peter Watson" <[EMAIL PROTECTED]> wrote:
>
> Property resut
>
>
>
> Typo here: event.resut.UserInfo.BrokerID
>
>
>
> resut --> result
>
>
>
>
>
> ________________________________
>
> From: [EMAIL PROTECTED]ups.com
[mailto:[EMAIL PROTECTED]ups.com]
On
> Behalf Of flycl65
> Sent: Thursday, August 03, 2006 1:13 AM
> To: [EMAIL PROTECTED]ups.com
> Subject: [flexcoders] Newbie Help - simple login via CFC
>
>
>
> 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>
>