Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

LoadVars and arrays 1

Status
Not open for further replies.

Icelizard

Programmer
Feb 9, 2006
17
GB
I am using LoadVars to load over 400 int into m,y flash script, i want to be able to put them in an array. But i dont want to have to put myArray.push("var1", "var2", "var3", "etc");

in php i would do something like:

for ($i = 1; $i <= 400; $i++) {
$tmp = "var";
$tmp .= $i;
$value = ${$tmp};
array_push($array, $value);
}

This would put all 400 variables into the array.

Can this be done in flash? or is there a better way to do this? or even pass in an array from a php script?

Any help would be greatly appreciated.
 
Thanks for the reply, i will keep that in mind, the way i got round it was to, send the vars in like.... vars=var1,var2,var3,var4,etc instead of var1=var1&var2=var2&var3=var3 etc then i used

tmparray = c["vars"];
_global.arrray = tmparray.split(",");

which split all the vars up and put them in an array! hopefully this might come in useful for urself one day! (if u didnt know that which i am sure you did! lol)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top