RE: [Flashcoders] Sort within an object

2006-06-19 Thread Merrill, Jason
How about a for loop combined with a temp array? function sortScores(dataArray:Array):Array{ var tempArr:Array = new Array(); for(var i=0; idataArray.length; i++){ tempArr.push(dataArray[i].score); } tempArr.sort() return tempArr; } var

Re: [Flashcoders] Sort within an object

2006-06-19 Thread janosch
Hello, is Track an array? Janosch Mendelsohn, Michael schrieb: Hi list... Is there any way to sort within an object: Track[1][score] Track[2][score] Track[3][score] Track[4][score] Track[5][score] All the tracks have different score numeric values. What's the most efficient way of

RE: [Flashcoders] Sort within an object

2006-06-19 Thread Mendelsohn, Michael
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

RE: [Flashcoders] Sort within an object

2006-06-19 Thread Merrill, Jason
is Track an array? Track is an object. Why would it be an object? Unless I don't get what you're trying to do (which is possible) Track should instead be an array, containing objects, as in my example. AKA a named element array. Jason Merrill Bank of America Learning Technology Solutions

Re: [Flashcoders] Sort within an object

2006-06-19 Thread Charles Parcell
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:

RE: [Flashcoders] Sort within an object

2006-06-19 Thread Mendelsohn, Michael
Well, thanks everyone for the advice. I ended up solving the issue, and below is my final code. Sorry if I confused anyone. - MM private function updateStandings():Void { var tempStandings:Array = new Array(); // first, create list of scores and sort

RE: [Flashcoders] Sort within an object ....

2006-06-19 Thread Steven Sacks | BLITZ
Yes, objects are hashes. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Stephen Ford Sent: Monday, June 19, 2006 5:28 PM To: flashcoders Subject: [Flashcoders] Sort within an object I thought all objects were associative arrays ? Is this

RE: [Flashcoders] Sort within an object ....

2006-06-19 Thread Steven Sacks | BLITZ
Sorry. Yes to your first question. No to your second. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Steven Sacks | BLITZ Sent: Monday, June 19, 2006 5:58 PM To: Flashcoders mailing list Subject: RE: [Flashcoders] Sort within an object Yes