You want to create an array that uses named elements instead of numbered indexes.
Create an associative array.
When you are working with sets of data in which each element has a specific meaning or importance, a typical, number-indexed array does not always suffice.
For example, if you are working with a set of data such as the names of members of a committee, a number-indexed array is sufficient:
members = new Array("Franklin", "Gina", "Sindhu");
However, if each member of the committee plays a special role, a
standard array offers no way to indicate that. To address
the issue, you can use an
associative array (sometimes called a
hash table or simply an
object). An associative array uses named
elements rather than numeric indexes. The names used to refer to
elements are often called
properties. The keys can give a meaningful
context to the associated element value.
You can create an associative array in
literal notation (which will be shown shortly) or by
adding elements to an object. Despite their name, you
don’t use the
Array class to
create associative arrays. The
provides methods and properties that work with number-indexed arrays
only and not with associative arrays. Associative arrays must be
instances of the
Object class. Technically,
Object class is the base class for all ActionScript classes, all ActionScript objects are associative arrays. You can use this ...