LoadVars weird

For some reason I had to do this to steal myvariable from my text file, otherwise it wouldn’t recognize it…

actionscript:


loadText = new loadVars();
loadText.load("max.txt");
loadText.onLoad = function(success) {
	if (success) {
blarg = loadText.toString();
maxpics = blarg.slice(8,blarg.indexOf("&"));
nextFrame(); 
}
} 

text:

&maxpics=12

Is there someway to wait until the variable is correctly loaded or something… :-\ this is really bugging me.

-thanks in advance

also what is success in the if statement? I can’t really find any good sources for the undocumented actionscript like fscommand and sending to PHP. Any links would be uber-helpful :-o

the success variable tells you if the loading was successfull or not. its either true or false.

onLoad is called when the loading process finished.

so basically:
loadText.onLoad = function(success) {
if (success) {
/your code here
}
}
already waits till the code is finished if it possible to load it

coolio thx, sorry for writing way more than I needed too, that’s a bad tendency of mine :slight_smile: