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.
Format an array

Format an array

2004-03-08       - By Simon Lord

 Back
Reply:     1     2     3     4     5     6  

I made a functional little loop that splits an array and sends it out
to a text field.  The problem is the result is not really what I want.  
I want the result to put each item on a new line instead of using a
comma.

The array contains a list of usernames with the pipe character as the
deliminator.  I split this out but all it did was remove my pipe and
replaced it with a comma.  :P

So, what I have is:

tony,martha,sam,dave...

... what I want is:

tony
martha
same
dave

Here is the code I cobbled together:

var userList = this.theText.split("|");
z = 0;
var outputArray = new Array();
while (z<userList.length) {
  outputArray.push(userList[z]);
  z++;
}
_root.listnames = outputArray;


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:106314
=-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- --
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.