# Arrays

**URL:** <https://forum.kirupa.com/t/arrays/317351>\
**Category:** Uncategorized\
**Created:** [December 17, 2010, 2:34pm UTC](https://forum.kirupa.com/t/arrays/317351 "2010-12-17T14:34:36Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![crosseout](https://avatars.discourse-cdn.com/v4/letter/c/8baadc/32.png) [@crosseout](https://forum.kirupa.com/u/crosseout)\
**Post date:** [December 17, 2010, 2:34pm UTC](https://forum.kirupa.com/t/arrays/317351/1 "2010-12-17T14:34:36Z")

</div>

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?

```auto

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

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

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

```
