views:

220

answers:

2

Hello friends, I have the following code in action script 3:

async.addResponder(new Responder(result, defaultFaultHandler));

result is a function that receives data from remoteobjet async, calling this function normally, but must go along with other arguments result, example:

async.addResponder(new Responder(result(args...), defaultFaultHandler));

How should I proceed in this way? I tried many things, but see no solution yet.

Thanks to everyone now.

+1  A: 

Try this:

async.addRespondor(new AsyncResponder(resultHandler, faultHandler, token));

where resultHandler and faultHandler are function references and token can be an arbitrary object you want access to later. Then in your resultHandler, you get the token like this:

function resultHanlder(result:ResultEvent, token:Object):void 
Marplesoft
A: 

You can use a closure like this.

async.addResponder(
          new Responder(function(event) { result(event, args); }, 
                        defaultFaultHandler)
          );
Sam
Thank you all worked perfectly!
luiz