[code]
var leads:Array = new Array();
for (var i:int = 0; i < data.categories.length; i++) { //drawpoints(data.categories[i]); var _lv:LeadView = new LeadView(i, data.categories[i].name); addChild(_lv); leads.push(_lv); } leads[0].x = ystart+5; leads[0].y = sh - yend + 20; var j:int; for (i = 1; i < data.categories.length; i++) { leads[i].x = leads[i - 1].x + leads[i - 1].w + 5; if (leads[i].x+leads[i].w <= (sw - JsonData.endx)) { leads[i].y = sh - yend+20; } else { j = i; leads[j].x = ystart + 5; leads[i].y = sh - yend + 40; j++; continue; yend = 60; leads[0].y = sh - yend + 20; leads[i].y = sh - yend + 40; leads[j].x = leads[j - 1].x + leads[j - 1].w + 5; } } [/code]