jalb
10-21-2002, 03:04 PM
Hi,
I would like to build a very simple Flash module that loads a list of string into a ListBox so that the user can make a choice. I use Flash MX. My problem is that I am unable to load the content of the data.txt file directly into the actionscipt variable. If I load it in a TextField to display it, there is no problem.
My data.txt contains : var1=string1;string2;string3;
My Actionscipt is at level 0 in the first layer and my ListBox is test23:
var1;
this.loadVariables("data.txt", 0);
test23.setSelectedIndex(0);
toke(var1);
function toke(liste)
{
rotate = true;
point = 0;
while (rotate) {
index = liste.indexOf(";",point)
if (index==-1) rotate=false;
else {
sub = liste.substring(point,index);
test23.addItem(sub,sub);
point = index+1;
}
}
}
How can I load data located in text files into ActionCript ?
Thank you.
Jalbert
I would like to build a very simple Flash module that loads a list of string into a ListBox so that the user can make a choice. I use Flash MX. My problem is that I am unable to load the content of the data.txt file directly into the actionscipt variable. If I load it in a TextField to display it, there is no problem.
My data.txt contains : var1=string1;string2;string3;
My Actionscipt is at level 0 in the first layer and my ListBox is test23:
var1;
this.loadVariables("data.txt", 0);
test23.setSelectedIndex(0);
toke(var1);
function toke(liste)
{
rotate = true;
point = 0;
while (rotate) {
index = liste.indexOf(";",point)
if (index==-1) rotate=false;
else {
sub = liste.substring(point,index);
test23.addItem(sub,sub);
point = index+1;
}
}
}
How can I load data located in text files into ActionCript ?
Thank you.
Jalbert