Arrays and Variables - Difference?

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.

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).

Don’t forget the tutorial on kirupa!

http://www.kirupa.com/developer/actionscript/array.htm

:hr:

so

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

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

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

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

would

trace(mylist[0]);

would the output be “a”?

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

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