Groups | Blog | Home
all groups > flash actionscript > march 2004 >

flash actionscript : Multidimensional array



Uzuul
3/16/2004 10:02:11 PM
Let's say I have the following multidimensional array

PeopleArray = new Array();
PeopleArray[0] = {fname:"Steve", sname:"Jones", gender:"male", Age:"28"}
PeopleArray[1] = {fname:"Marc", sname:"Simpson", gender:"male", Age:"25"}
PeopleArray[2] = {fname:"Jane", sname:"Baer", gender:"female", Age:"30"}
? and so on

Question 1:
What would be the best way to extract the fname of the youngest person?

Question 2:
BTW how would you sort the above multidimensional array on a the age field?

Question 3:
Is it possible to have an additional field in the same array that is
calculated using data not pertaining to the array like AgeDif that would be
the age of the person minus a constant or variable? How?

Thank you very much in advance!
Marc

tralfaz
3/18/2004 3:14:18 PM
If you have not already found the answer....
I have spent some time studying the sorting of multidimensional arrays. I
have uploaded an example here...
http://members.cox.net/4my5cats/ArraySort.html
tralfaz


[quoted text, click to view]

AddThis Social Bookmark Button