# Help With Arrays

**URL:** https://forum.kirupa.com/t/help-with-arrays/171603
**Category:** flash
**Created:** [December 6, 2005, 8:24pm UTC](https://forum.kirupa.com/t/help-with-arrays/171603 "2005-12-06T20:24:38Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![pln1llyln0clc3y](https://avatars.discourse-cdn.com/v4/letter/p/e47774/32.png) [@pln1llyln0clc3y](https://forum.kirupa.com/u/pln1llyln0clc3y)
#### Post date: [December 6, 2005, 8:24pm UTC](https://forum.kirupa.com/t/help-with-arrays/171603/1 "2005-12-06T20:24:38Z")

</div>

It seems to me that there should be a way for me to optimize this into an array and a loop. But I know practically nothing about arrays. Can someone help me.

```auto

 name.onSetFocus = function() {
 	nameframe.gotoAndStop(2);
 };
 name.onKillFocus = function() {
 	nameframe.gotoAndStop(1);
 };
 address.onSetFocus = function() {
 	addressframe.gotoAndStop(2);
 };
 address.onKillFocus = function() {
 	addressframe.gotoAndStop(1);
 };
 city.onSetFocus = function() {
 	cityframe.gotoAndStop(2);
 };
 city.onKillFocus = function() {
 	cityframe.gotoAndStop(1);
 };
 state.onSetFocus = function() {
 	stateframe.gotoAndStop(2);
 };
 state.onKillFocus = function() {
 	stateframe.gotoAndStop(1);
 };
 zip.onSetFocus = function() {
 	zipframe.gotoAndStop(2);
 };
 zip.onKillFocus = function() {
 	zipframe.gotoAndStop(1);
 };
 phone.onSetFocus = function() {
 	phoneframe.gotoAndStop(2);
 };
 phone.onKillFocus = function() {
 	phoneframe.gotoAndStop(1);
 };
 email.onSetFocus = function() {
 	emailframe.gotoAndStop(2);
 };
 email.onKillFocus = function() {
 	emailframe.gotoAndStop(1);
 };
 

```
