Cycle through array on click

K, I’ve got 3 different arrays


var tumbler1:Array = new Array("some stuff","more stuff","and more");

var tumbler2:Array = new Array("text","more text","and more text");

var tumbler3:Array = new Array("yep","yep yep","yep yep yep");

Then I’ve got 3 dynamic text fields on the stage with respective variable names so they populate with the first item in each array.


var t1:String = tumbler1[0];
var t2:String = tumbler2[0];
var t3:String = tumbler3[3];

Next I have some buttons on top each text field where I want when say the first button is pressed (btn1, which is over the t1 text field) the next item in the array is used to populate the text field.


btn1.onRelease = function(){
// in theory i tried this but doesn't work, just get undefined
for (var i=0; i<=tumbler1.length; i++){
	t1 = tumbler1*;
	}
}

Also if possible, if the last item in the array was being used, if you click again it’ll start back over at the first item.