# 'Reset' an array

**URL:** <https://forum.kirupa.com/t/reset-an-array/200804>\
**Category:** flash\
**Created:** [September 15, 2006, 9:06am UTC](https://forum.kirupa.com/t/reset-an-array/200804 "2006-09-15T09:06:50Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![scousehouse](https://avatars.discourse-cdn.com/v4/letter/s/e19b73/32.png) [@scousehouse](https://forum.kirupa.com/u/scousehouse)\
**Post date:** [September 15, 2006, 9:06am UTC](https://forum.kirupa.com/t/reset-an-array/200804/1 "2006-09-15T09:06:50Z")

</div>

Hello all,  
I have a set of buttons defined by an array with the following script:  
ActionScript Code:  
[FONT=Courier New][LEFT]myButtons= [COLOR=#000000] **new** [/COLOR] [COLOR=#0000FF]Array[/COLOR] COLOR=#000000[/COLOR]  
[COLOR=#0000FF]for[/COLOR] [COLOR=#000000]([/COLOR]i [COLOR=#0000FF]in[/COLOR] myButtons[COLOR=#000000])[/COLOR][COLOR=#000000]{[/COLOR]  
[COLOR=#0000FF]this[/COLOR][COLOR=#000000][[/COLOR]myButtons[COLOR=#000000][[/COLOR]i[COLOR=#000000]][/COLOR][COLOR=#000000]][/COLOR].[COLOR=#0000FF]onPress[/COLOR]=[COLOR=#000000] **function** [/COLOR]COLOR=#000000[/COLOR][COLOR=#000000]{[/COLOR]  
[COLOR=#0000FF]this[/COLOR].[COLOR=#0000FF]gotoAndStop[/COLOR]COLOR=#000000[/COLOR]  
[COLOR=#000000]}[/COLOR]  
[/LEFT]  
[/FONT]

This script enables the MCs to go to frame 2 when pressed. This works fine

The problem is this:

```
ActionScript Code:
[FONT=Courier New][LEFT]gobutton.[COLOR=#0000FF]onPress[/COLOR]=[COLOR=#000000] **function** [/COLOR][COLOR=#000000]([/COLOR][COLOR=#000000])[/COLOR][COLOR=#000000]{[/COLOR]
[COLOR=#0000FF]this[/COLOR][COLOR=#000000][[/COLOR]myButtons[COLOR=#000000][[/COLOR]i[COLOR=#000000]][/COLOR][COLOR=#000000]][/COLOR].[COLOR=#0000FF]gotoAndStop[/COLOR][COLOR=#000000]([/COLOR][COLOR=#000080]1[/COLOR][COLOR=#000000])[/COLOR]

```

[COLOR=#000000]}[/COLOR]  
[/LEFT]  
[/FONT]

I was hoping that MC would take all of the array MCs to frame 1.

But it doesn’t work!

Any ideas!?

(fla attached)
