| you do control both sides of this, right? |
Yes, the args are set with Flex and sent with SOAP:
var ws:WebService = new WebService();
ws.loadWSDL("http://192.168.254.123:18383/service?wsdl");
ws.endpointURI = "http://192.168.254.123:18383";
ws.loadWSDL();
var params:Object = new Object();
params.scriptLanguage = "javascript";
params.scriptFile = scriptFilepath.text;
params.scriptArgs = new Array();
params.scriptArgs.push({name:myName, value:myValue});
ws.RunScript(params);
| In any case, you could try packing all your args into a single scriptArg |
How to pack all the args in one single scriptArG?
I don't know any AS3, but your code looks a bit odd:
params.scriptArgs = new Array();
params.scriptArgs.push({name:myName, value:myValue});
ws.RunScript(params);
That's not inside a loop, so you are just sending one arg? So why not use
params.scriptArgs.push({name: "arg", value:(myName+":"+myValue));
and then in ExtendScript:
var arg, myName, myValue;
arg = app.scriptArgs.get("arg").split(":");
myName=arg[0];
myValue=arg[1];
Of course this uses a literal ":" as a seperator -- if that might appear in your name or value, you'd have a problem. If so there are a hundred ways to solve it, probably the easiest way is to use the .toSource() method [how does that work in AS3?] to bundle it all together. Similarly if you're passing an array.