Lab
Flash :: 가로, 세로 정렬!!
threeword
2009. 4. 28. 15:12
.Variable
var colSpacing:uint = 233; /// 무비클립 한개의 넓이 (간격포함)
var rowSpacing:uint = 134; /// 무비클립 한개의 높이 (간격포함)
var totalCols:uint = 3; /// 행 갯수
var totalRows:uint = 3; /// 열 갯수
.Code
for(var i:uint = 0; i < totalCols * totalRows; i++){
var totalRows:uint = 3; /// 열 갯수
.Code
for(var i:uint = 0; i < totalCols * totalRows; i++){
DisplayObject.x = (i % totalCols) * colSpacing;
DisplayObject.y = Math.floor((i) / totalCols) * rowSpacing;
}