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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

loadVars.sendAndLoad Problem

Status
Not open for further replies.

digiduck

Programmer
Apr 4, 2003
95
0
0
US
first off i'm just learning flash mx and i'm trying to make a from that sends some variables to an asp page and then retrieves variables from that asp page using the loadVars.sendAndLoad function. I've already made the asp page and i know nothing is wrong with it so here is the flash code i'm trying to use. this code is in the actions for a pushbutton.
Code:
on (release) {
   sendto=sendto.getValue(); //Get Value of a ComboBox
   name=_root.name.text; //Get value of a text field
   email=_root.email.text; // ' '
   message=_root.email.text; // ' '

   x = new loadVars();
   x.sendAndLoad("[URL unfurl="true"]http://www.site.com/page.asp",x,"POST");[/URL]
   // page.asp should return a variable 'stat' I want to get that value here
   _root.name.text=stat;
}
Please. any help will be appreciated.
 
on (release) {
x = new loadVars();
x.sendto=sendto.getSelectedItem(); //Get Value of a ComboBox
x.name=_root.name.text; //Get value of a text field
x.email=_root.email.text; // ' '
x.message=_root.email.text; // ' '


x.sendAndLoad(" // page.asp should return a variable 'stat' I want to get that value here
x.onLoad = function(){
_root.name.text=x.stat;
}
}
 
Ok thanks. that works great. Only I can't get the combobox part to work. For testing it I setup a pushbutton with the following code to retrieve the data of the selected item in the combobox..
Code:
on (release) {
   trace(combo1.GetSelectedItem().data);
}
problem is that it keeps returning "undefined" I have the box loaded with values & data.....
 
the code look fine

i would stick the traces in the main button
to get a beeter idea of whats going on

on (release) {
x = new loadVars();
x.sendto= _root.sendto.getSelectedItem().data;
trace(_root.sendto.getSelectedItem().data)
trace(_root.sendto.getSelectedItem().label)



if the traces still come back undefined then make sure that the instance name of the combo is coorect...if it is then it must be the path to the combo that is wrong
 
Thanks I got it working now. I had left out the _root part.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top