• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 223
  • Last Modified:

Form Action associated with a button within FLash movie

I want to assign the following html code to a button within a flash movie:

<form action="http://formmail.dreamhost.com/cgi-bin/formmail.cgi" method="POST">
     <input type="hidden" name="required" value="realname,email">
     <input type="hidden" name="recipient" value="info">
     <input type="hidden" name="subject"      value="Information">
     <input type=hidden name="env_report" value="REMOTE_HOST,HTTP_USER_AGENT,REMOTE_ADDRtest3">

In a HTML doc, this would hit the CGI script and automatically send their comments to the info email address. How would I go about this within a flash movie?
0
dripa
Asked:
dripa
1 Solution
 
BillystyxCommented:
on the button in flash, put this code:
on(release){
loadVariables("http://formmail.dreamhost.com/cgi-bin/formmail.cgi","","POST");
gotoAndPlay("loading");//where loading is a frame label name of a loop following the button
}



If you are returning variables to flash, then make sure your cgi script returns a final variable like:
success=1

then in flash, in the above mentioned loop:
if(success=="1"){
gotoAndStop("succeeded");//where suceeded is the frame label for the frame where you wish to display your returned variables
}

Billystyx
0
 
ddlamCommented:
you can use loadVars():

Timeline, frame 1, add the following action scripts:

//below is similar to  <form>
forwardData = new LoadVars();

//below is similar to hidden parameters
forwardData.required = "realname,email";
forwardData.recipient = "info";
forwardData.subject = "Information";
forwardData.env_report = "REMOTE_HOST,HTTP_USER_AGENT,REMOTE_ADDRtest3";

//below is similar to press submit button
forwardData.send("http://formmail.dreamhost.com/cgi-bin/formmail.cgi", "POST");
0

Featured Post

Important Lessons on Recovering from Petya

In their most recent webinar, Skyport Systems explores ways to isolate and protect critical databases to keep the core of your company safe from harm.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now