Actionscript Code:
var minLetterIndex:uint = 0;
var maxLetterIndex:uint = array.length -1;
var currentLetterIndex:uint = 0;
function arrowClick(e:MouseEvent):void {
if (e.target == leftArrow) {
if (currentLetterIndex > minLetterIndex) textBox.text = array[currentLetterIndex], currentLetterIndex --;
else if (currentLetterIndex == minLetterIndex) textBox.text = array[maxLetterIndex], currentLetterIndex = maxLetterIndex;
} else if (e.target == rightArrow){
if (currentLetterIndex < maxLetterIndex) textBox.text = array[currentLetterIndex], currentLetterIndex ++;
else if (currentLetterIndex == maxLetterIndex) textBox.text = array[minLetterIndex], currentLetterIndex = minLetterIndex;
}
}