Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Labels in Array

Participant ,
Nov 17, 2015 Nov 17, 2015

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.

TOPICS
ActionScript
355
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Enthusiast , Nov 17, 2015 Nov 17, 2015

trace(atkList[0].frame);

trace(atkList[0].h);

trace(atkList[0].l);

trace(atkList[1].frame); //etc..

Translate
Enthusiast ,
Nov 17, 2015 Nov 17, 2015

trace(atkList[0].frame);

trace(atkList[0].h);

trace(atkList[0].l);

trace(atkList[1].frame); //etc..

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Nov 18, 2015 Nov 18, 2015

Ok, it works perfectly.

Thanks!

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Nov 18, 2015 Nov 18, 2015
LATEST

You're welcome.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines