I would like to call RemoteObject operations in a generic way.So I have a
function that takes an Operation arguments and the arguments to send in an
array:
public function
run(action:Operation,arguments:Array,resultHandler:Function,faultHandler:Function
= null):void{
action.addEventListener(ResultEvent.RESULT, resultHandler);
if(faultHandler != null){
action.addEventListener(FaultEvent.FAULT, faultHandler);
}
action.send(arguments);
}
Now the problem is that Operation.send() takes only a rest array parameter.
So if I call my run function for arguments=null or arguments=[], send() sees
it as one parameter anyway and my call doesn't go through. Is there a way to
dereference an array in ActionScript like it's possible in Python for
example? Is it possible to call Operation.send() without knowing arguments
at compile-time?
Best regards,
Sébastien Arbogast
http://sebastien-arbogast.com
http://mooplan.com