leearach2004
Technical User
Hi there
Im having a few problems with variables I have loaded from a text file using LoadVars().
They all load fine and everything works o.k but the problem I am having is refrencing the text inside these variables.
What I have is an array created as so
list = new Array(this.name0,this.name1,this.name2,.....);
I know there are esier ways of populating array but ill change that later.
So my array contains all the variables from my text file.
Now if I do somthing like
TextFeild.text = list[1];
The variable text is displayed in the text field
But before i display the text in need to check what is contained in the variable.
If it equals 0 then dont dispaly it and if it doesnt equal 0 then display the text.
I used an if statment like this
randdisplay is a text area
r is a random variable
if(list[r]==0){
some code;
}else{
randdisplay.text = list[r];
}
this should then only display the variables that do not equal 0 but it does not work it also display the 0's as well.
hope somone can help me
lee
Im having a few problems with variables I have loaded from a text file using LoadVars().
They all load fine and everything works o.k but the problem I am having is refrencing the text inside these variables.
What I have is an array created as so
list = new Array(this.name0,this.name1,this.name2,.....);
I know there are esier ways of populating array but ill change that later.
So my array contains all the variables from my text file.
Now if I do somthing like
TextFeild.text = list[1];
The variable text is displayed in the text field
But before i display the text in need to check what is contained in the variable.
If it equals 0 then dont dispaly it and if it doesnt equal 0 then display the text.
I used an if statment like this
randdisplay is a text area
r is a random variable
if(list[r]==0){
some code;
}else{
randdisplay.text = list[r];
}
this should then only display the variables that do not equal 0 but it does not work it also display the 0's as well.
hope somone can help me
lee