Posted on Friday 13 May 2005
Before there was mx.utils.Delegate, there was mx.rpc.RelayResponder, which does sort of the same thing but in the context of Remoting callbacks. It's used like so:
var pc:PendingCall = service.doStuff();
pc.responder = new RelayResponder(this, "handleOk", "handleRemotingError");
Well I really like mx.utils.Delegate and I think the syntax would benefit from being consistent across the two. So I've created a new class, mx.rpc.Relay, which works like so:
var pc:PendingCall = service.doStuff();
pc.responder = Relay.create(this, handleOk, handleRemotingError);
The two benefits are more consistency with Delegate and syntax errors if you misspell the function name. Get mx.rpc.Relay here.


