Action script /asp form problem
- Started
- Last post
- 6 Responses
- pufeta
Hello,
I have a client that made their own form in flash- here is the code:stop();
//set tab order.
reset_btn.tabEnabled = true;
send_btn.tabEnabled = true;
fname2.tabIndex = 1;
lname2.tabIndex = 2;
email2.tabIndex = 3;
phone2.tabIndex = 4;
title2.tabIndex = 5;
message2.tabIndex = 6;//set the values.
fname2.onSetFocus=function(){
fname2.text = "";
}
lnamet2.onSetFocus=function(){
lname2.text = "";
}
email2.onSetFocus=function(){
email2.text = "";
}
phone2.onSetFocus=function(){
phone2.text = "";
}
title2.onSetFocus=function(){
title2.text = "";
}
message2.onSetFocus=function(){
message2.text = "";
}function SubmitForm() {
// Initialize form variables to send to ASP
formData = new LoadVars();
formData.MoreInfo = _level0.MoreInfo;
formData.username = fname2.text;
formData.username = lname2.text;
formData.useremail = email2.text;
formData.userphone = phone2.text;
formData.usertitle = title2.text;
formData.usermessage = message2.text;// do something with the results, call function Successful Submit
replyData = new LoadVars();
replyData.onLoad = SuccessfulSubmit;formData.sendAndLoad("submitForm...
}function SuccessfulSubmit()
{
gotoAndPlay("ty");
}________
so on the submit button I have placed this:on (release) {
gotoAndPlay("ty");
formData.sendAndLoad("submitForm...
}But when the fileds are entered....the text doesn't get saved to our ASP page. what code should the submit button have so that when the text is entered in the form fields it gets saved to the asp page and we can see the text?
thank you very much..... i apprecite any help.
- pufeta0
PLEAASSSSSSSSE help
- spmitch0
your button just needs to call the function and your asp needs to send back success
- spmitch0
on(release){
this.SubmitForm()
};
- pufeta0
i adore you!
- pufeta0
it didn't work. i am not sure why.. but thanks
- skel0
in AS1/AS2, scope within an function remains on the object itself rather than the timeline where your scripts are. it's a classic AS problem.
the most proper way to get around this is to remove that script that's on the button (the one that says on(release)) ...then add an instance name to it if it doens't have one (for the example of the code i'm giving you, call it submitButton)... then deselect the button so that in the actions panel you're adding script to the timeline again and add this:
import mx.utils.Delegate;
submitButton.onRelease = Delegate.create(this,SubmitForm...