okay...I have a dynamically created list of radiobuttons (in groups) and a click event that when I click on a radiobutton, it captures the button's information and adds it to an Array Collection.
private var myArray:ArrayCollection = new ArrayCollection;
The resulting Array Collection ends up being something like: '1,2,3,4,5,6,7,8,9' (when traced), which is what I want. However, this is only if the user goes down and click on the radiobuttons in the order they appear from top to bottom as each radiobutton, when created, is assigned an id and value. (I am adding the value to the Array Collection).
The problem I am having is when a user clicks randomly and when traced, the result of the Array Collection is: '1,4,2,3,5,6,9,8,7'. But when I watch the expresion 'myArray', it shows the following:
So the Array Collection, when watched, is in the correct order. If I save and come back to the page, the trace will show the correct results. I need to get the correct results BEFORE I save so I can compare it against some other results I have for validation puroses.
So, without using a dataprovider, list, etc...(only using actionscript), is there away once the Array Collection information has been added, to sort the information so when I trace the results of myArray, it is in the correct order always by its index?
Hope this makes sense.
Thanks in advance!
My apologies if I'm not addressing your specific problem, but I think you can just apply a simple sort to your results ArrayCollection as necessary. Take a look at http://blog.flexexamples.com/2007/08/05/sorting-an-arraycollection-using-the-sortfield-and -sort-classes/ on using the Sort classes, and use a simple SortField as described at http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/spark/collections/Sort. html to sort a collection of simple items.
Flex SDK engineer