Step 6: Adding Action Scripting to the Submit Button
Right click on the layer call "Buttons". In the menu that appears select Lock Others. This will allow us to focus on just the buttons.
Right click on the submit button at the bottom right hand side of the form. Select Actions in the menu that appears. This will open your Actions Panel. Click on the "+" sign at the top left hand side of the panel. Select Actions, set variable. This will insert some code into your Actions panel. In the field titled Variable type in "subject". In the field titled Value enter "Feed Back Form". You can give the Value field anything you want. This is the subject that will appear in email that the form sends.
Click on the "+" again and Select Actions, set variable to insert another variable. Type in "recipient" for the field titled Variable. Type in your email address for the field titled Value. This is where you tell the cgi script where to email the form results. Setting variables here is like creating hidden form fields in HTML.
The cgi script now knows what the subject is and who to send the results to, but we still have to tell Flash to send the field values that the user fills out (FirstName, LastName, ect.). For this we use the loadVaribles action.
Click on the "+" sign. Select Actions, loadvariables. In the field titled URL type in the web address of the form to mail script that your using. Leave the Location field to 0. Select "Send using GET" from the Variables pull down menu.
All right, now we're gettin' somewhere. When the user selects the submit button we not only want the information sent to us via email, but we want to thank our users for the feed back. So after the variables are loaded, which we just did, we want to send the user to the personal thank you frame.
Click on the"+". Select Basic Actions, Go to. The Go to code will be inserted into the Actions panel. Leave the the Scene field to <current scene>. Select Frame Label from the Type pull down menu and type in "ThankYou" in the field titled Frame. "ThankYou" is the name of the frame we will be creating very soon.
When we select our submit button and take a look at the Actions panel our code should be similar to the image above. It's important that the code is in the above order. If something is out of order you can use the up or down arrows at the top right hand side of the Actions panel to move the code up or down a level.
|» Level Intermediate|
Rating: 7.91 Votes: 202
|No details available.|
|Download the files used in this tutorial.|
|Download (104 kb)|
|More help? Search our boards for quick answers!|