public function setShop():void
{
// shopList2.removeAllElements();
// var list:VGroup = new VGroup();
// list.percentWidth = 100;
// list.percentHeight = 100;
if(!shopes)return;
// var scroll:Scroller = new Scroller();
// scroll.percentWidth = 100;
// scroll.percentHeight = 100;
// scroll.setStyle("skinClass","com.wks.skins.scroller.Scroller_skin");
// skinClass="com.wks.skins.scroller.Scroller_skin"
// list.addElement(scroll);
// shopList.addElement(scroll);
var titlG:TileGroup = new TileGroup();
titlG.percentWidth = 100;
titlG.percentHeight = 100;
titlG.setStyle("horizontalAlign","center");
titlG.orientation = TileOrientation.ROWS;
titlG.autoLayout = true;
var slength:int = shopes.length;
for(var i:int=0; i<slength; i++)
{
var currshop:Shop = shopes.getItemAt(i) as Shop;
var vb:RowComp = new RowComp();
vb.rowData = currshop;
vb.cakeList = shopes;
vb.currentCakeIndex = i;
if(vb.cakename != null)
{
vb.setRow();
}
titlG.addElement(vb);
}
scroll.viewport = titlG;
// shopList.addElement(titlG);
titlG.addEventListener(ResizeEvent.RESIZE, changeSize);
}
private function changeSize(event:ResizeEvent):void
{
var currTile:TileGroup = event.currentTarget as TileGroup;
var rowNum:int = currTile.numElements;
if(rowNum > 0)
{
var tilewidth:Number = currTile.width;
var row:RowComp = currTile.getElementAt(0) as RowComp;
var rowwidth:Number = row.width;
var childNum:int = tilewidth/rowwidth;
if(childNum > 1)
{
currTile.horizontalGap = (tilewidth - row.width * childNum)/(childNum - 1);
}
}
}
titleGroup
原创
©著作权归作者所有:来自51CTO博客作者x_jie130的原创作品,请联系作者获取转载授权,否则将追究法律责任
上一篇:flex键盘事件
下一篇:scroller skin
![](https://ucenter.51cto.com/images/noavatar_middle.gif)
提问和评论都可以,用心的回复会被更多人看到
评论
发布评论