# SortOn() array function

**URL:** <https://forum.kirupa.com/t/sorton-array-function/321228>\
**Category:** flash\
**Created:** [April 13, 2011, 6:01pm UTC](https://forum.kirupa.com/t/sorton-array-function/321228 "2011-04-13T18:01:51Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![sk138](https://avatars.discourse-cdn.com/v4/letter/s/dbc845/32.png) [@sk138](https://forum.kirupa.com/u/sk138)\
**Post date:** [April 13, 2011, 6:01pm UTC](https://forum.kirupa.com/t/sorton-array-function/321228/1 "2011-04-13T18:01:51Z")

</div>

I have an array of objects. The objects have a base class with various properties. Each time an object gets created, I push it into the array. However, I need to sort the objects based on one of their properties.

Lets say in my object class, I have a function “ReturnNumber()” that returns a number, I want to sort my array based on which number was the highest. Can I use SortOn() to do this?
