This isn't 100% perfect, but I've cobbled together a pretty good solution. The only problem now is using the ensureIndexIsVisible function, as it doesn't necessarily put the desired index at the top of the screen. I'm probably going to work on a workaround for that too though.
Relevant Actionscript code:
protected function getItemIndexByProperty(array:ArrayCollection, property:String, value:String):int
{
for (var i:int = 0; i < array.length; i++)
{
var obj:Object = Object(array[i])
if (obj[property] == value)
return i;
}
return -1;
}
protected function getNearestTeamIndex(teamnumber:int):int
{
for (var i:int = teamnumber; i < (teamnumber+10); i++)
{
var result:int = getItemIndexByProperty(teamListArray,'teamnumber',i.toString());
if (result != -1)
return result;
}
return -1;
}
Relevant MXML code
<s:VGroup width="10%" height="100%" horizontalAlign="center" verticalAlign="middle" color="0x999999">
<s:Label id="firstIndex" text="1-999" click="teamList.ensureIndexIsVisible(getNearestTeamIndex(1))"/>
<s:Spacer height="10"/>
<s:Label id="secondIndex" text="1000's" click="teamList.ensureIndexIsVisible(getNearestTeamIndex(1000))"/>
<s:Spacer height="10"/>
<s:Label id="thirdIndex" text="2000's" click="teamList.ensureIndexIsVisible(getNearestTeamIndex(2000))"/>
<s:Spacer height="10"/>
<s:Label id="fourthIndex" text="3000's" click="teamList.ensureIndexIsVisible(getNearestTeamIndex(3000))"/>
<s:Spacer height="10"/>
<s:Label id="fifthIndex" text="4000's" click="teamList.ensureIndexIsVisible(getNearestTeamIndex(4000))"/>
<s:Spacer height="10"/>
<s:Label id="sixthIndex" text="5000's" click="teamList.ensureIndexIsVisible(getNearestTeamIndex(5000))"/>
</s:VGroup>