Hi all,
I was actually watching a tutorial about how to make a highscore table. The problem is it was done in AS2 and I’m using AS3. I’ve been searching tutorials for 2 days and so far I’ve converted what I could. In the AS2 tutorial he uses loadVariables which works for him and I’ve successfully used URLVariables to pull in my php variables in AS3. But, when he pulls in his variables for instance name1=“happy”,score1=“100”, he uses the set command and these variables can automatically be referenced by var1 and var2 respectively and can populate the dynamic text fields of his score board. Set works differently in AS3 and using URLVariables I see the string of name/value pairs and I’ve split them up with an array, but, when I try to display them AS3 treats these name/value pairs as a value of the array instead of name/value pairs. I understand that you can load URLVariables as name/value pairs, but, how do you get AS3 to treat them as name/value pairs once the string is loaded?
Sample code:
var sumString:String = event.target.data;
var sumArray:Array= sumString.split("&");
trace(sumArray); //this shows the whole array string
anotherArray[a].text=sumArray[a];
trace(anotherArray[a].text);
// This last trace will display sumString.text=“TopWinner” which is not what I’m looking for. Then if I take the sumString.text= portion out of my php file then its not a name/value pair anymore. How can I get this to be treated as a name/value pair?