# sortOn help

**URL:** <https://forum.kirupa.com/t/sorton-help/214984>\
**Category:** Uncategorized\
**Created:** [February 2, 2007, 5:33pm UTC](https://forum.kirupa.com/t/sorton-help/214984 "2007-02-02T17:33:41Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![onecommoncode](https://avatars.discourse-cdn.com/v4/letter/o/47e85d/32.png) [@onecommoncode](https://forum.kirupa.com/u/onecommoncode)\
**Post date:** [February 2, 2007, 5:33pm UTC](https://forum.kirupa.com/t/sorton-help/214984/1 "2007-02-02T17:33:41Z")

</div>

I have an array that looks like:

```auto

var navArray:Array = new Array();
navArray.push({name:"hi", file:"file0.swf", num:"0"});
navArray.push({name:"test", file:"file1.swf", num:"1"});
navArray.push({name:"sweet", file:"file2.swf", num:"2"});

```

I have my fla setup, so that each “name” gets pushed into a movieclip onto the stage. Everything works correctly and all my mc’s show up on the stage with the correct “name” inside of them.

```auto

var newNav = _root.attachMovie("mcNavigation", "mcNav_" + navArray*.name, _root.getNextHighestDepth(), {_x:xPos, _y:yPos});

newNav.mcNavigationText.htmlText = navArray*.name;

```

I have a button that when clicked it will sortOn(“name”). This works fine, but now I want to make another button that will sortOn(“num”). I think the problem is when I first attach the mc to the stage, I am referncing navArray\*.name. Is there a way to reference two objects so that I can sort both of them with different buttons?

Thanks
