There is some confusion here. These two different statements you have made
don't add up.
In your first post you sited the example:
Track[1][score]
Track[2][score]
Track[3][score]
Track[4][score]
Track[5][score]
These are nested arrays.
But in the code listed here you have the line of code:
if(_root.puz["track"]["table" + t]["score"] == tempScores[i])
This code would trace out something like...
// _root.puz.track.table1.score
This is indeed an object tree.
Since it looks like you actually are building object trees, I would suggest
you look at using a Bubble sort.
<http://en.wikipedia.org/wiki/Bubble_sort>
The version sited here is a bit less elegant than the recursive version, but
it works just the same.
Charles P.
On 6/19/06, Mendelsohn, Michael <[EMAIL PROTECTED]> wrote:
> is Track an array?
Track is an object.
This is my work in progress...
////////////////////////////////
private function updateStandings():Void {
// create list of scores and sort descending...
var tempScores:Array = new Array();
for (var s = 1; s < 9; s++) {
tempScores.push(_root["t" +
s].pieces.text.substring(0, (_root["t" + s].pieces.text.lastIndexOf("
"))));
}
tempScores.sort(2);
// match scores to tables by going through tempScores
and finding a table with that value, then throwing it out of
tempTables...
var tempTables:Array = new Array(1,2,3,4,5,6,7,8);
var newStandings:Array = new Array();
for(var i=0;i<tempScores.length-1;i++){
for(var t=1;t<9;t++){
if(_root.puz["track"]["table" +
t]["score"] == tempScores[i]){
trace(i + " " + t);
}
}
}
trace(tempScores);
}
_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com
_______________________________________________
[email protected]
To change your subscription options or search the archive:
http://chattyfig.figleaf.com/mailman/listinfo/flashcoders
Brought to you by Fig Leaf Software
Premier Authorized Adobe Consulting and Training
http://www.figleaf.com
http://training.figleaf.com