PDA

View Full Version : LoadVars weird



unikrl8
July 24th, 2004, 08:54 PM
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

McGiver
July 24th, 2004, 09:09 PM
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

unikrl8
July 25th, 2004, 04:51 PM
coolio thx, sorry for writing way more than I needed too, that's a bad tendency of mine :-)