;

PDA

Click to See Complete Forum and Search --> : How to fill a array


RobVos
08-31-2005, 10:06 AM
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.

pherbrick
08-31-2005, 06:36 PM
Can you post a zip of your text and fun files? It would take the guess work out of finding a solution.

blanius
08-31-2005, 09:47 PM
words="one,two,three,"

myArray=words.split(",");

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

works just fine.