Mailing List
Home
Forum Home
Flash Pro
Subjects
Firework Effect
setInterval bug identified and fixed
setInterval bug identified and fixed
ScrollPane component doesn 't auto update
Help: MX 2004 How to script a print button to print the entire sli
Event Dispatcher between classes
memory management removeMovieClip /
MX2004 Dataset itemClassName
Order of events per frame
XML to Object help
Textfield prototype question
Flash and QuickTime VR
Reading and displaying RSS feeds in Flash MX
Flash MX 2004 Sucks
AW: [Flashcoders] Switch/Case vs If/else
AW: [Flashcoders] Switch/Case vs If/else
Flash Interface with 10mb xml file
Web Service Results
Listener Object 's best practice
 
Search:  
Power your search with and, or, +, -, or "some phrase" operators.
sort()

sort()

2004-03-08       - By Gregg Wygonik

 Back
Reply:     1     2     3     4     5     6  

i'll assume your "list of usernames in a variable" is a delimited
list... so if you want to sort the contents of the string, overwriting
the unordered list, you could do something like this:

var a = "g|a|c|b|d|f|e|o|q|p|v|x|z|y";
a = a.split("|").sort().toString().split(",").join("|");
trace(a);

or - if you just want to output the values sorted, and leave the
original variable un-changed:

var a = "g|a|b|c|d|e|f|o|p|q|v|x|z|y";
trace(a.split("|").sort().toString().split(",").join("\n"));

hth
g.

-- --Original Message-- --
From: Simon Lord [mailto:slord@(protected)]

I now have a list of usernames in a variable that gets dumped to a
field.  How can I sort the names in the variable so that when they get
dumped to the field they are sorted ascending from a to z?

Sincerely,
Simon

=-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- --
Supported by Fig Leaf Software
=-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- --
Be sure to check the archives and the wiki:
http://chattyfig.figleaf.com/
=-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- --
http://chattyfig.figleaf.com/cgi-bin/ezmlm-cgi?1:mss:106347
=-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- --
To unsubscribe send a blank e-mail to:
Normal Mode: flashcoders-unsubscribe@(protected)
Digest Mode: flashcoders-digest-unsubscrive@(protected)




Earn $52 per hosting referral at Lunarpages.