A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: How to fill a array

  1. #1
    Member
    Join Date
    May 2004
    Location
    Netherlands
    Posts
    58

    How to fill a array

    I try to fill a array with a textfile from the server.

    i load the txtfile with loadVariables("naam.txt","_level0");
    I have a dynamic textbox with the name of the var from the text file and i can see the data from the text file in the dynamic textbox.

    It looks like: "hello,this,is,a,example,"

    I have five dynamic textboxes and i want them filled with the text.
    do i have to use something like:

    myArray=txt1.text;
    myWord=naam.split(",");
    trace(myWord[0]);
    txt2.text=myWord[0]
    txt3.text=myWord[1]
    txt4.text=myWord[2]
    etc.

    But the problem is that the txt2 and 3 and 4 etc.text files stay empty.
    I hope someone has a solution for me

    I found a solution i think. At least it does the job.
    I include a file with the text and the fun file. So if someone want's to see it working be my gast. Thanks for the replies.
    Attached Files Attached Files
    Last edited by RobVos; 09-01-2005 at 08:29 AM. Reason: Found Solution

  2. #2
    Senior Member pherbrick's Avatar
    Join Date
    Jul 2004
    Location
    Los Angeles
    Posts
    291
    Can you post a zip of your text and fun files? It would take the guess work out of finding a solution.

  3. #3
    KoolMoves Moderator blanius's Avatar
    Join Date
    Jul 2001
    Location
    Atlanta GA
    Posts
    5,244
    words="one,two,three,"

    myArray=words.split(",");

    txt1.text=myArray[0]
    txt2.text=myArray[1]
    txt3.text=myArray[2]

    works just fine.

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