首页 > 代码库 > flex for循环
flex for循环
一:for
var i:int;for (i = 0; i < 5; i++){trace(i);}
二:for ...in
循环object:
var myObj:Object = {x:20, y:30};for (var i:String in myObj){trace(i + ": " + myObj[i]);}// output:// x: 20// y: 30
循环array:
var myArray:Array = ["one", "two", "three"];for (var i:String in myArray){trace(myArray[i]);}// output:// one// two// three
三、foreach...in
循环object:
var myObj:Object = {x:20, y:30};for each (var num in myObj){trace(num);}// output:// 20// 30
循环array:
var myArray:Array = ["one", "two", "three"];for each (var item in myArray){trace(item);}// output:// one// two// three
flex for循环
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。