I’m trying to use this example of loadVars that I found here.
I have this in frame 1 of a loading scene
var load_lv = new LoadVars();
//Step 2
load_lv.load(“text.txt”);
//Step 3
load_lv.onLoad = loadTextVariables;
//Step 4 next level 1 frame 29
Later in the scene in frame 29 I test to see if it
was successfull
function loadTextVariables(success){
if(success){
nextFrame();
} else {
gotoAndPlay(2);
}
The movie continues on past the loading scene to
the main movie scene, so I assume it read the variables.
However I don’t get any of the values for the variables.
What did I miss?
Since I wrote the above, I was told I have to have all the code in one frame,
not two as I have above, so here is the rest of my question.
I want to read the text.txt in frame 1 so it can start reading it as soon as possible.
I wanted to test to see if it was read later in the scene so it would have time to
load.
If I have to read it in frame 1 and test it in frame 1, and if “success” is negative
then where can I loop back to, so I can test it again.
When I use loadVariablesNum it works ok except in Firefox ( sometimes), so I think firefox may get past the reading of the file to quick (sometimes). I don’t want it to give me a trace or anything else. I want to give it time to read the text.txt file and loop around the loading scene until its finished. Can I just let it go part way through the loading scene and then play frame 1 again. If it does the load_lv.load(textFile), again it seems it will just try to read again and I don’t know if that will just overlay the original data, and not accomplish anything.
So, where do I send it to when “success” is false.?