Arrays

Alright, I obviously don’t understand arrays very well. I want to cycle through the content of an array by the push of a button. The dynamic text field registers the variable “aar”, because when I preview this it displays “item1”. When I then hit the button, the variable “i” is increased by 1, the dynamic field with the variable “i” shows this, but the dynamic field with the variable “aar” is not updated to the next array-item.

This code is in the first frame, with no stop(); code in the file at all… Why doesnt this code work?


aar = new Array();
aar[0]="item1"
aar[1]="item2"
aar[2]="item3"


_root.button.onRelease = function(){
    i++;
    }

var i:Number = 0;
var aar = aar*;