actionscript 3 中遍历数据首选for each…in

从php送回的json数据中,是对象或者数组,用for each…in来遍历是最好的方法(最快)。
php对于array(‘a’=>1,’b'=>2)转换为json,发给flash,flash通过json类转换json为对象
object {
‘a’:1,
‘b’:2
}

for each(var item in object){
    trace(item);//输出1,2
}

2 Responses to actionscript 3 中遍历数据首选for each&... »

  1. 安踏anta 评论 2009-06-09 11:47

    学习中。。。

    回复

  2. 安踏anta 评论 2009-06-09 11:48

    学习了。。。。 :o

    回复

Leave a Reply

Email address is not published

You should say a Chinese word to pass spam check. If you can not input Chinese, just copy 你好 and paste them into comment text box.