Text Files - A Variable Question
Hey,
I promise this will be the last thread regarding text files for a while, and no this isnt regarding how you integrate them with Flash, because Ive learnt up to that point :)
But I've run into a little problem which is the last of many problems to complete this little assignment.
My question is, how do you use a variable in flash to tell flash which value to get from the text file. Normally you would say something like:
dynamicText.text = this.value1;
But what if you dont know which value is going to be chosen, so you use a variable instead like this:
code:
myData= new LoadVars();
myData.onLoad = function() {
whichStuff = "stuff3";
dynamicText.text = this.whichStuff // in other words 'this.stuff3'
};
myData.load("text files/dataText.txt");
The problem is, it returns an undefined value and so doesnt work. Does anyone have any input on this?