xmlns:mx="http://www.adobe.com/2006/mxml"
layout="absolute">
private function changeScrollToShowChild():void
{
vbox.verticalScrollPosition = (getChildrenHeight((comboBox.selectedItem as Number)+1)) - vbox.height + 40;
}
private function getChildrenHeight(index:int):Number
{
var i:int = 0;
var sumHeight:Number = 0;
while(i sumHeight += vbox.getChildAt(i).height;
i = i +1;
}
return sumHeight;
}
1
2
3
verticalScrollPolicy="off" paddingLeft="50">