arr是包含object的数组
var str:String="";
for each (var o:Object in arr)
{
//遍历object类的所有属性,判断是否符合被选中的条件
var objInfo:Object=ObjectUtil.getClassInfo(o); //flex ObjectUtil工具类
var fieldName:Array=objInfo["properties"] as Array;
var code:String="";
for each (var q:QName in fieldName)
{
//q.localName 属性名称,value对应的值
var value:String=o[q.localName] as String;
var valueArr:Array=value.split(",");
if (value.indexOf(",") != -1 && valueArr.length == 2)
{
if (valueArr[1] == "true")
code=code + q.localName + ",";
}
}
if (code != "")
code=code.split(0, code.length - 1);
str=str + "<resourcePower user_id='" + o.USERID + "' powercode='" + code + "' />"
}