Use the Object Utility to Show you what is being returned and then you
will be able to trace it down.

<mx:Script>
        <![CDATA[
      
                        import mx.utils.ObjectUtil;
                        import mx.controls.Alert;


                        private function server_fault(event:FaultEvent):void
                        {
                                // dump error message
                                Alert.show( ObjectUtil.toString(event.fault) );
                        }

                        private function 
getQuery_result(event:ResultEvent):void 
                        {
                        
                                Alert.show(ObjectUtil.toString(event.result));
                                
                        }
                        
        ]]>
    </mx:Script>


Hope this helps

Rich


--- In [email protected], "Darren Houle" <[EMAIL PROTECTED]> wrote:
>
> Assuming this is Delegate code... Implementing the Caringorm Responder 
> requires an onResult(event:*=null):void method, but implementing
IResponder 
> requires a result(data:Object):void method, so... this looks like
something 
> kinda the same as IResponder only different.
> 
> It accepts the Object arg like IResponder but the method isn't named 
> result().  Not sure, but if this is a Delegate but it's some kind of
custom 
> IResponder then that pattern would also probably accept an Object.
> 
> The documentation for IResponder says "While data is typed as
Object, it is 
> often (but not always) an mx.rpc.events.ResultEvent" so... the code
below 
> also accepts Object for the same reason (I guess) except that they're 
> letting coercion happen instead of accepting a ResultEvent as the
arg or 
> explicitly casting it as a ResultEvent.
> 
> Darren
> 
> 
> 
> >From: João Fernandes <[EMAIL PROTECTED]>
> >Reply-To: [email protected]
> >To: <[email protected]>
> >Subject: RE: [flexcoders] Re: Newbie Help - simple login via CFC
> >Date: Thu, 3 Aug 2006 15:31:49 +0100
> >
> >Put a breakpoint here "private function login_result(event:
Object):void"
> >
> >And run your app in debug mode and check your event object.
> >
> >
> >
> >BTW, shouldn't be login_result(event:ResultEvent):void instead?
> >
> >
> >
> >João Fernandes
> >Dep. Informática - Área de Desenvolvimento
> >Cofina media
> >
> >Avenida João Crisóstomo, Nº 72 . 1069-043 Lisboa PORTUGAL
> >Tel (+351) 213 185 200 . Fax (+351) 213 540 370
> >[EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>
> >
> >________________________________
> >
> >From: [email protected]
[mailto:[EMAIL PROTECTED] On 
> >Behalf Of flycl65
> >Sent: quinta-feira, 3 de Agosto de 2006 15:25
> >To: [email protected]
> >Subject: [flexcoders] Re: Newbie Help - simple login via CFC
> >
> >
> >
> >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]
<mailto:flexcoders%40yahoogroups.com> , 
> >"Peter Watson" <pwatson@> wrote:
> > >
> > > Property resut
> > >
> > >
> > >
> > > Typo here: event.resut.UserInfo.BrokerID
> > >
> > >
> > >
> > > resut --> result
> > >
> > >
> > >
> > >
> > >
> > > ________________________________
> > >
> > > From: [email protected]
<mailto:flexcoders%40yahoogroups.com>  
> >[mailto:[email protected]
<mailto:flexcoders%40yahoogroups.com> ] 
> >On
> > > Behalf Of flycl65
> > > Sent: Thursday, August 03, 2006 1:13 AM
> > > To: [email protected] <mailto:flexcoders%40yahoogroups.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");
> > > }
> > > }
>






--
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