Hi, I have an array with about 80 variables in it and everything is working fine, but I can’t seem to figure out how to produce a variable name from the array.
Example: I sort my array to get the highest value, then I cannot retrieve the actual name of the variable that holds the value.
var p1:Number = 1;
var p2:Number = 2;
var pArray:Array = new Array(p1,p2);
pArray.sort(Array.DESCENDING | ARRAY.NUMERIC);
trace(pArray[0]);
I will get “2”, but I want it to say “p2”.
I looked into “toString” and toLocaleString but they also gives me the number value.