Copy link to clipboard
Copied
I have an array that holds frame labels and high and low damage values, like so.
var atkList:Array = [{frame:'punch',h:1800,l:1000}, {frame:'overkick',h:750,l:1250}];
I don't know how to access the properties of each object. I've tried a few methods but none work.
trace(atkList[0].frame);
trace(atkList[0].h);
trace(atkList[0].l);
trace(atkList[1].frame); //etc..
Copy link to clipboard
Copied
trace(atkList[0].frame);
trace(atkList[0].h);
trace(atkList[0].l);
trace(atkList[1].frame); //etc..
Copy link to clipboard
Copied
Ok, it works perfectly.
Thanks!
Copy link to clipboard
Copied
You're welcome.
Find more inspiration, events, and resources on the new Adobe Community
Explore Now