Updated question:
Is there a way to sort dynamic texts based on the variable (or simple value) they represent?
Old dribble:
I'm looking for some pointers for a problem with making a table. It may be that I have started off in the wrong direction - anyways, I'm stuck now.
The .png displays my objects, and how they are connected/grouped.
The highlighted (red) shows the variable containing the points. The pink with the most points should be displayed higher than the rest, and 2nd most points should ofc be 2nd highest. I have tried taking the red variable out of the pink, but I could not think of a way of moving the red variable based on its own value.
So, if anyone have anything to help me here, I'm a happy man.
I'm going to edit the red variables (as the world cup goes on), and there is no need for cookies and such.
And if there is a simpler way of doing the setup, let me know. I'm using SwishMax3 (SM2 up till a few days ago, so I'm more used to as2..)
urup is the name for just the one dynamic text displaying the one variable. I have 4 dynamic text, each displaying the variable containing the points for just that team.
But I'm guessing I can make it the name of all the text fields, as long as the variable being displayed differ from each one..
I put that bit of code in "grupa" (green)? I am trying as I type, but no luck as of yet.
Thnx for replying, how ever. Feel more confident it will eventually work now
A little change from neznein9s code. And it sorts and outputs as it sorts. Only problem is it sorts on letter in var a:Array, and not the values inside a.sortOn().
Can't seem to get my head around this.
pRSA, pMEX, pURU and pFRA are all groups containing the variables in my sortOn(**HERE**)
pRSA.rsap, pMEX.mexp, pURU.urup and pFRA.frap are variables containing points for each group (they are located in the groups mentioned before aswell (as you can see).
I think the problem is that the sortOn() does not look at the variable defining pRSA.rsap and the other dynamic texts inside the sortOn()-function. It only sorts on the name of the dynamic text and not what it displayes.
Is there a way to sort dynamic texts based on the variable (or simple value) they represent?