# Special kind of array sorting

**URL:** <https://forum.kirupa.com/t/special-kind-of-array-sorting/233934>\
**Category:** flash\
**Created:** [July 28, 2007, 10:22am UTC](https://forum.kirupa.com/t/special-kind-of-array-sorting/233934 "2007-07-28T10:22:39Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Esseti](https://avatars.discourse-cdn.com/v4/letter/e/bb73d2/32.png) [@Esseti](https://forum.kirupa.com/u/Esseti)\
**Post date:** [July 28, 2007, 10:22am UTC](https://forum.kirupa.com/t/special-kind-of-array-sorting/233934/1 "2007-07-28T10:22:39Z")

</div>

Hello.

I need some help on writing a function that will sort this array:

```auto
var newArray:Array = [<game title="Game Two" date="5.05.2007"><pics /><videos /></game>, <game title="Game One" date="5.06.2007><pics /><videos /></game>]

```

By the ‘title’ attribute, or the ‘date’ attribute.

I know that I can use Array.sort() for this, but it will only work with the first attribute.

Please help.
