Issue with retrieving variables
Hi. Got help with some code on here before. Basically, it retrieves values from my php page and displays them in my flash movie. The code I am using is
var n:uint=1;
var tl:MovieClip=this;
try {
var keyStr:String;
var valueStr1:String;
var valueStr2:String;
var paramObj:Object=LoaderInfo(this.root.loaderInfo).parameters;
for (keyStr in paramObj) {
tl["valueStr"+n]=String(paramObj[keyStr]);
n++;
}
} catch (error:Error) {
}
myString=valueStr1;
myString1=valueStr2;
The problem is this. On my html page, I type in two values for the first name and last name, say "Nick" and "Price". The above method retrieves these values and stores them in two Strings. I then display them using a text field. Now sometimes, everything works normal, and variable 1 holds "Nick" and variable 2 holds "Price". On other occassions however, its the opposite, and variable 1 holds "Price" and variable 2 holds "Nick". This is a big problem when I come to display them, as they are back to front.
My adding to the text field is straight forward (not all code included, but two text fields are created and each variable added to one of these)
tf.text="To "+myString;
addChild(tf);
tf1.text="Love "+myString1;
addChild(tf1);
I was wondering if this error could be caused by what I am doing above, or how I am assigning the variables to myString and myString1?
cheers