A Flash Developer Resource Site

Results 1 to 2 of 2

Thread: Sorting an Array of Objects

  1. #1
    Junior Member
    Join Date
    Jan 2006
    Posts
    18

    Sorting an Array of Objects

    Hi,

    I have this array of objects, each element of the array contains 3 properties, (link:String, level:Number, Count:Number). I want to sort my array ascendingly based on the 'level' property. Any idea how to do that?

    Best Regards

  2. #2
    All 1s and 0s dmonkey's Avatar
    Join Date
    Nov 2005
    Location
    Leeds, UK
    Posts
    606
    Hi,

    I believe you should be able to just use the sortOn method:

    myArray.sortOn("level");

    Hope that helps.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center