You have to use the selectedIndex property of the TileList
class, just retrieve which is the current index of the selected picture and increase/decrease it by one in your next/prev functions.
You will also need some logic to disable the prev button when the first picture is selected, and disable the next button when the last picture is selected, and enable them both when necessary.
Something like this should work:
function prevF(e:Event):void
{
if(tileList.selectedIndex >0)
{
tileList.selectedIndex = tileList.selectedIndex-1;
//trigger image change
//(no event is dispatched on selectedIndex set)
imageChanger(null);
//reenable next button
next_mc.enabled=true;
}
//disable prev button if first
if(tileList.selectedIndex==0)
{
prev_mc.enabled=false;
}
}
function prevF(e:Event):void
{
if(tileList.selectedIndex < (tileList.length-1))
{
tileList.selectedIndex = tileList.selectedIndex+1;
//trigger image change
//(no event is dispatched on selectedIndex set)
imageChanger(null);
//reenable prev button
prev_mc.enabled=true;
}
//disable next button if last
if(tileList.selectedIndex==(tileList.length-1))
{
next_mc.enabled=false;
}
}
Hope this helps!