Glen Pike
Thu, 27 Aug 2009 08:40:14 -0700
Hi Ian,
Thanks for the support on that - I would agree, think the coder is being a bit lazy here.The backend shouldn't care about element order. :-)
//I was looking at doing something like:
if(params){
var keys:Array = new Array();
for each (var key:String in obj) {
keys.push(key);
}
keys = keys.sort(null, |Array.CASEINSENSITIVE|);
cmd.command.appendChild(<parameters/>);
for(var i:int = 0;i < keys.length;i++) {
var par:String = keys[i];
var parXML:XML = <{par}>{params[par].toString()}</{par}>;
cmd.command.parameters.appendChild(parXML);
}
}
/*which might be a bit slower, but I am already looping through the
object anyway, so only hardcoding my end would speed it up and speed was
not a requirement (yet)*/
But that sort of hard-coding feels totally wrong, and makes me think that there is too much hardcoding going on at the C++ end.
Yep... lazee coders :) Ta Glen _______________________________________________ Flashcoders mailing list Flashcoders@chattyfig.figleaf.com http://chattyfig.figleaf.com/mailman/listinfo/flashcoders