When you call a remote function through Flash remoting, the server will
return the result into the location that you specify in the connection
code.

i.e.

If you have the following connection code:

if (isGatewayOpen == null) {  
        // do this code only once  
        isGatewayOpen = true;  
        
        // Make the Gateway connection  
        NetServices.setDefaultGatewayUrl("/flashservices/gateway");  
        gatewayConnnection = NetServices.createGatewayConnection();  
        userService= gatewayConnnection.getService("mycomponent", this);


}

The result of function calls will be returned to the current movie.

If you want to catch the result of the function, you will need to create
a function in your action script. The name of the function that catches
the result is the same as the name of the remote function with _result
appended to it.

so if you had a function called getusers() in your CFC, you would need
to create a function called getusers_result() in your actionscript.

In order to work with the result that gets passed to it, you would also
need to define the function as taking a parameter.

Something like this:

function getUsers_Result(result){
        

        // Assign the user data to an actionscript variable
        _root.qUsers = result;
        
        // Bind the user data to a combo box component
        dataGlue.bindFormatStrings(user_list, result, "#fullname#",
"#userid#");
        
        _root.users_loaded = true;
                
}

All this is assuming that you have the following line in your
actionscript:

userService= gatewayConnnection.getService("mycomponent", this); 

specifically that you are returning the result of the component calls
into 'this'.

If you return the result in to something else such as a responder
object, you would have to do something different with your actionscript.

I'd guess from the message that you're getting that you have the
connection set up to return the result into 'this'.


Spike


Stephen Milligan
Team Macromedia - ColdFusion
Co-author 'Reality Macromedia ColdFusion MX: Intranets and Content
Management'
http://spikefu.blogspot.com

> -----Original Message-----
> From: Giles Roadnight [mailto:[EMAIL PROTECTED]] 
> Sent: 16 December 2002 12:06
> To: [EMAIL PROTECTED]
> Subject: RE: [ cf-dev ] Flash Remoting Net Connection Debugger
> 
> 
> Hi Guys
> 
> For some reason when I use flash remoting to run a particular 
> function on the server I always get a debug message coming up 
> telling me that a response was received from the server:
> 
> NetServices info 1: function_Result was received from server: 
> [object Object]
> 
> I can't se anything in the code that would make this happen. 
> It doesn't happen for other functions.
> 
> Can anyone tell me why?
> 
> Thanks
> 
> Giles Roadnight
> http://giles.roadnight.name
> 
> 
> 
> 
> -- 
> ** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/
> 
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: 
> [EMAIL PROTECTED] For human help, e-mail: 
> [EMAIL PROTECTED]
> 
> 
> 


-- 
** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/

To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
For human help, e-mail: [EMAIL PROTECTED]

Reply via email to