PDA

View Full Version : how to convert string into a variable of LoadVar object


smazherhq
05-26-2005, 09:47 PM
Hi guys!
I am recieving info from my data source, say myTextBox, myCombo & myRadio. i created the dynamic copies of these component & placed them on stage. In meantime, i also added their names to an array. what i wanna do is, when user clicks the submit button(which is always placed already there), then script should recieve values from my array, & send the info in them using a loadvars.

for example! i created instances of a textfield component( & called it myTf), an instance of combobox( & called it myCb) & a radio group( & called it myRd). While creating these instances, i also added their names to an array as:
myArr.push("myTf"); //& so on
what i wanna do is, when i press the submit button, then flash should go to the array, recieve the names of new components, then recieve the value from those components which my array indicates, then add the retrieved value & the name of that component in the load vars & send them to my server side script.

So far, i can recieve the name of instances from the array & can recieve the value from the respective components but i m unable to add the name of component & its corresponding value to my loadvar object.

say var myLv:LoadVars = new LoadVars();
myLv.mycomponentNameShouldGoHere = theValueOfComponent(the value part is easy but how can i dynamically add the name of an instance to the loadvar varable object.

Any suggesstions please!!!

Xeef
05-26-2005, 10:10 PM
mycomponentNameShouldGoHere="Password"
myLv[mycomponentNameShouldGoHere] ="BlaBla"