A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: new at arrays - have dumb problem!

  1. #1
    I need to have my array items listed out like this:

    a
    b
    c

    (without no commas....)

    the closest i've come is this:

    wrong=new Array()
    wrong[0]=../../:setWhichWrong
    wrong[1]=newline
    wrong[2]=../../:ifWrong
    ../../:quotes=wrong;
    ../../:setWhichWrong=wrong;

    i'm pretty excited about having gotten this far on my own (it's the little things...) but it's a dumb work-around.

    please give me some advice, oh flash gurus!!!

  2. #2

    Can you have an array w/o commas??? (re-phrasing)

    OK, i think i phrased this badly.

    Can anyone tell me how to make an array with no commas between items???


  3. #3
    Senior Member
    Join Date
    Jun 2001
    Location
    las vegas,nv
    Posts
    694
    Okay. I'm not sure how you're creating or using the array but this will loop through and put each element on a new line:
    Code:
    var n=new Array();
    n[0]=a;
    n[1]=b;
    n[2]=c;
    n[3]=d;
    
    for(l=0;l<n.length;l++){
    	trace(n[l]+newline);
    }
    Replace the trace with this to display the array:
    Code:
    tf+=n[l]+newline;//tf is name of dynamic textfield
    [Edited by dzlpwr on 07-01-2002 at 12:33 AM]

  4. #4
    OK. I'll try that. Thanks!!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center