# Sorting Associative Arrays

**URL:** <https://forum.kirupa.com/t/sorting-associative-arrays/229209>\
**Category:** flash\
**Created:** [June 14, 2007, 9:24pm UTC](https://forum.kirupa.com/t/sorting-associative-arrays/229209 "2007-06-14T21:24:32Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![nburlington](https://yyz1.discourse-cdn.com/flex011/user_avatar/forum.kirupa.com/nburlington/32/1365_2.png) [@nburlington](https://forum.kirupa.com/u/nburlington)\
**Post date:** [June 14, 2007, 9:24pm UTC](https://forum.kirupa.com/t/sorting-associative-arrays/229209/1 "2007-06-14T21:24:32Z")

</div>

I have two arrays. One contains numbers and the other contains strings. I want to do a

sortOn(DECENDING) for the number array and then have the string array sort to match.

if my string array is

string[0] = “morning”;  
string[1] = “noon”;  
string[2] = “night”;

number[0] = 3;  
number[1] = 1;  
number[2] = 2;

i’ll sort the number array and that’s fine. but can i apply that same sort to the string array?
