your problem might be, that the variables are not loaded when you try to use them. It takes quite some frames before you actually can use the loaded variables in actionscript.
Example:
content of text.txt:
var1=abc
the following commands put in the same frame will produce an empty box evoked by the trace command:
loadVariables (“text.txt”, _root);
trace(var1);
A trace command directly after a loadVariables-command shows you nothing, because the variables actually did not load yet.
Whereas the same trace command put in frame20 (or so) will show a box containing “abc” (the value of var1)
A dynamic Textbox actually shows the variables’ value, since you don’t really recognize the time it takes for the variables to load and the textbox gets currently updated.
Is there an easier way to use a numeric value from a textfile, than to use – int(substring(variable,0,1)) – ? Cause otherwise there seems to be a problem with the linefeed/carriage return characters coming from the textfile plus the variable is a string and not an integer.
Now that’s interesting. Why is it better to use loadVars ? Because basically, you just turned the onData handler into an onLoad handler, no ? Just curious.
You’re right… the onData verifies that data was actually acquired. That makes a huge difference in the code. I’m sure you can see the immediate benefits.