actionscript 3 - If I have a multidimentional array, how can I acsess only the first value of the first dimention? -


if have multidimentional array, how can acsess first value of first dimention. explain:

samplearray=new array[];  samplearray[0]=["nouns","adjectives","verbs"]; samplearray[1]=["colors","time","sound]; samplearray[0][0]=["person","place","thing"] 

i word nouns when try value ofsamplearray[0][0] result person, place, thing!

in sample code "nouns" located @

samplearray[0][0] 

however replacing with

samplearray[0][0]=["person","place","thing"] 

perhaps easier keep information in object. reference them way. not sure end goal though may not work you.

var partsofspeach = {}; var noun = {}; noun.name = "noun"; noun.def = ["person","place","thing"]; partsofspeach.noun = noun; 

then can access info at

trace(partsofspeach.noun.name); // "noun" trace(partsofspeach.noun.def); // "person","place","thing" 

Comments

Popular posts from this blog

IF statement in MySQL trigger -

c++ - What does MSC in "// appease MSC" comments mean? -

javascript - Blogger related post gadget image Resize s72-c [ Need Expert Help ] -