# Incrementing an Array of Movies

**URL:** <https://forum.kirupa.com/t/incrementing-an-array-of-movies/151145>\
**Category:** flash\
**Created:** [June 13, 2005, 6:05pm UTC](https://forum.kirupa.com/t/incrementing-an-array-of-movies/151145 "2005-06-13T18:05:15Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Tr0nik](https://avatars.discourse-cdn.com/v4/letter/t/a587f6/32.png) [@Tr0nik](https://forum.kirupa.com/u/Tr0nik)\
**Post date:** [June 13, 2005, 6:05pm UTC](https://forum.kirupa.com/t/incrementing-an-array-of-movies/151145/1 "2005-06-13T18:05:15Z")

</div>

[font=verdana, arial, helvetica][size=2]Hi all, I’m trying to create a spinner for different ads for an advertising company website. Each ad has a name, such as “out” “pie” and “bigger”. All of them are turned off except “pie” to start off with:

[/size][/font][font=verdana,arial,helvetica][size=1]

```auto
[/size][/font]
//initialize movie
var itemArray:Array = new Array();itemArray[0] = out;
itemArray[1] = pie;
itemArray[2] = bigger;
itemArray[3] = better;
//
for (var i = 0; i<itemArray.length; i++) {	
var clip:MovieClip = itemArray*;	
clip._visible = false;
}
backBTN._visible = 0;
pie._visible = 1;

```

[font=verdana, arial, helvetica][size=2]The thing is, I can’ figure out the button script to cycle through this array. I want to click a forward and back button, lets use forward for now, and do something like (don’t mind the syntax):

[/size][/font]

```auto

on (release) { 
i+1, remember the spot, and make everything else invisible. 
When you click again, you increment to the 
next ad/instance name and so on.
}

```

What is the actual syntax for this?
