# 2 problems: variable as array name &

**URL:** <https://forum.kirupa.com/t/2-problems-variable-as-array-name/47890>\
**Category:** Uncategorized\
**Created:** [April 8, 2004, 1:10am UTC](https://forum.kirupa.com/t/2-problems-variable-as-array-name/47890 "2004-04-08T01:10:04Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![WarpSpider](https://avatars.discourse-cdn.com/v4/letter/w/a698b9/32.png) [@WarpSpider](https://forum.kirupa.com/u/WarpSpider)\
**Post date:** [April 8, 2004, 1:10am UTC](https://forum.kirupa.com/t/2-problems-variable-as-array-name/47890/1 "2004-04-08T01:10:04Z")

</div>

Ok, I’m trying to make an array generate from someone typing their name in an input box. The input makes the variable “arrayName” = -input-  
then in my code below i create an array with

```
 arrayName = new Array(4) (I want four array positions)

```

But in the input box, it just gives me this “,”

ok, moving on to second problem, lol

the slots in the array are changed with four buttons

```
 on(release) {
  _root.GR.arraySlot = 0;
 }

```

etc etc for 4 buttons. ok, so now on \_root.GR ( a movie clip) I’ve put this code.

```
set (arrayName, 0 );
set (gameNumber,0 );
set (userResult,0 );
set (compResult,0 );
arrayName = new Array(4)
computerArray = new Array(4)

```

And in a submit button I’ve put this:

\_root.GR.submitContinue.on(release) {  
\_root.GR.arrayName [\_root.GR.arraySlot] = \_root.GR.userResult  
}

ok, so to check my progress, I’ve added Dynamic Text to display every variable and then the array. I hit the big button, and whammo, nata.

Help :\ Lol, theres gotta be something wrong with the way I’m changing the variables and paths from inside other timelines. I even tried making every variable and array global, but I’m guessing I did that wrong too, cuz it didnt’t work either. I have to have this project done by tomorrow and I’m stressed out alot about it, lol. I’m brand new to AS and really would love your help! Thanks in advance!
