# Arrays and Variables - Difference?

**URL:** <https://forum.kirupa.com/t/arrays-and-variables-difference/62691>\
**Category:** Uncategorized\
**Created:** [August 30, 2004, 5:03pm UTC](https://forum.kirupa.com/t/arrays-and-variables-difference/62691 "2004-08-30T17:03:20Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![dcoltonbrown](https://avatars.discourse-cdn.com/v4/letter/d/ecccb3/32.png) [@dcoltonbrown](https://forum.kirupa.com/u/dcoltonbrown)\
**Post date:** [August 30, 2004, 5:03pm UTC](https://forum.kirupa.com/t/arrays-and-variables-difference/62691/1 "2004-08-30T17:03:20Z")

</div>

Can someone tell me the difference between arrays and variables? It seems as if the two terms are often interchanged. (Is it that arrays are objects?)

On that note, if I want to populate a listbox with an array or variable, how is it done? What if I want listbox info to define my array.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 30, 2004, 5:09pm UTC](https://forum.kirupa.com/t/arrays-and-variables-difference/62691/2 "2004-08-30T17:09:37Z")

</div>

a variable is a word that represents a value. A variable may contain a numberic value like 5, a string value like “hello” or an array value like [1,2,3,4,5] among many others. So if you have an array, chances are its assigned to some variable. That variable is then an array variable.

As for the listbox, it has certain methods associated with it that allow you to add items to it. These can be found in the components book in the left sidebar of the actions panel. For more information about any method, right-click and select View reference (or something to that effect).

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 30, 2004, 5:20pm UTC](https://forum.kirupa.com/t/arrays-and-variables-difference/62691/3 "2004-08-30T17:20:15Z")

</div>

Don’t forget the tutorial on kirupa!

[http://www.kirupa.com/developer/actionscript/array.htm](http://www.kirupa.com/developer/actionscript/array.htm)

:hr:

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 30, 2004, 5:21pm UTC](https://forum.kirupa.com/t/arrays-and-variables-difference/62691/4 "2004-08-30T17:21:39Z")

</div>

so

```auto
mylist= ["a","b","c"];

```

my list is the variable and a,b,c would be the arrays?

```auto
mylist.addItem("a");
mylist.addItem("b");
mylist.addItem("c");

```

would “a,b,c” still be an array?

would

```auto
trace(mylist[0]);

```

would the output be “a”?

Thanks for the help, I am learning but getting confused with some of the particulars.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/kirupa/original/3X/6/2/621e5c11736f46532526e61be85940af4230f3e5.png) [@system](https://forum.kirupa.com/u/system)\
**Post date:** [August 30, 2004, 5:24pm UTC](https://forum.kirupa.com/t/arrays-and-variables-difference/62691/5 "2004-08-30T17:24:55Z")

</div>

> [@lunatic](#):
>
> Don’t forget the tutorial on kirupa!
> 
> [http://www.kirupa.com/developer/actionscript/array.htm](http://www.kirupa.com/developer/actionscript/array.htm)
> 
> :hr:

Thanks, for some reason I just could not comprehend the difference! Call me stoopid! 🙂
