Hello all!
I’ve been working with LoadVars a lot recently and like it very much so. However, I have encountered a new problem. As always, I have searched through a bunch of threads to no avail; if this is a repeated question, please trout slap me and I’ll apologize! Anywho -
I have this array that already works in my Flash project:
angles = [0, 35, 100, 72, 72, 81];
Now I want to pull those numbers in the array from a changing PHP program. To start, I’m using a test file:
&p1=0&p2=35&p3=100&p4=72&p5=72&p6=81
Then I have actions like this right before I need those pulled in:
lv = new LoadVars();
lv.onLoad = function(success){
if(success){
p1 = this.p1;
p2 = this.p2;
p3 = this.p3;
p4 = this.p4;
p5 = this.p5;
p6 = this.p6;
trace(p1); //returns a zero
}
}
lv.load("myStupidTextFile.txt");
trace(p1); //returns 'undefined'
How do I get those variables to register outside of the loadVars? There has to be a way, right??!!