Flex 关于遍历

获取XML属性名、值
var x : XML = <page id="1000" name="zjk" aaa="23a"  bbb="23b"  ccc="23c"/>;
for each(var kid:XML in x.*){
     trace("属性名:" + kid.name() + " ,值:" + kid.toString());
}

获取Object属性名、值
var obj:Object = {a:"1",b:"2",c:"3"};
for(var i:String in obj)
{
	trace("属性名:" + i + " ,值:" + obj[i]);
}


XML使用参考http://hje.iteye.com/blog/308900

你可能感兴趣的:(Flex)