# sortOn with arrays

**URL:** <https://forum.kirupa.com/t/sorton-with-arrays/330827>\
**Category:** flash\
**Created:** [March 24, 2013, 2:04am UTC](https://forum.kirupa.com/t/sorton-with-arrays/330827 "2013-03-24T02:04:51Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Antsuperhack](https://avatars.discourse-cdn.com/v4/letter/a/c0e974/32.png) [@Antsuperhack](https://forum.kirupa.com/u/Antsuperhack)\
**Post date:** [March 24, 2013, 2:04am UTC](https://forum.kirupa.com/t/sorton-with-arrays/330827/1 "2013-03-24T02:04:51Z")

</div>

Hey all quick question … say I’ve got an array called activeArray

I’ve pushed various movieclips to the array and used sort to sort the array A-Z

If I now wanted to loop through the array and check if a property attached to each movieclip … let’s say that each movieclip looks something like player1.isOnline = true … how would I loop through the array and bring the movieclips with the isOnline property = true to the front?

I’m guessing I need to use sortOn? Oh and I’ve already removed any duplicate movieclips so I need to avoid adding anymore duplicates 🙂
