bmcc81
10-26-2007, 04:59 PM
Hi,
I'm trying to add 2 fields and combo box into the script I have.
The instance names are:
Instance name for ComboBox = input_txt // This one already works
Instance name for ComboBox = userEmail
Instance name for ComboBox = combo
Instance name for ComboBox = userComments
stop();
// ===========================================
// Simple Echo Form Demo
// Version: 1.0.2
// Written by: Colin Moock
// www.moock.org
// ===========================================
// Start the application.
initForm();
/*
* Function: initForm()
* Desc: Creates LoadVars objects for sending and
* receiving data to and from the server.
* Parameters: None.
*/
function initForm() {
// Create a reference to the form timeline.
_global.form_mc = this;
// Create the LoadVars objects.
// One to send...
dataSender = new LoadVars();
// ...and one to receive.
dataReceiver = new LoadVars();
// Assign a callback function to the dataReceiver's onLoad handler.
// It will process the variables when they arrive.
dataReceiver.onLoad = function () {
// Prepare the response clip for data display.
form_mc.response.gotoAndStop("doneLoading");
// Display the value of output, the loaded variable, in the output_txt field.
form_mc.response.output_txt.text = this.output;
}
}
/*
* Function: submitForm()
* Desc: Retrieves user input and sends it to the server.
* Parameters: None.
*/
function submitForm () {
// Assign the value of input_txt to a property of dataSender. The escape()
// function encodes the & character to avoid network transfer errors.
dataSender.formInput = escape(input_txt.text);
// Display a loading message in the response clip.
form_mc.response.gotoAndStop("loading");
// Display what we're sending in the output window, for debugging purposes.
trace("Sending " + dataSender.toString());
// Send the properties of dataSender to the server, and wait for a reply.
dataSender.sendAndLoad("http://www.moock.org/cgi-bin/actionscriptbook/simpleEcho/echo.pl",
dataReceiver, "GET");
}
My question is how do I add to the form?
I'm trying to add 2 fields and combo box into the script I have.
The instance names are:
Instance name for ComboBox = input_txt // This one already works
Instance name for ComboBox = userEmail
Instance name for ComboBox = combo
Instance name for ComboBox = userComments
stop();
// ===========================================
// Simple Echo Form Demo
// Version: 1.0.2
// Written by: Colin Moock
// www.moock.org
// ===========================================
// Start the application.
initForm();
/*
* Function: initForm()
* Desc: Creates LoadVars objects for sending and
* receiving data to and from the server.
* Parameters: None.
*/
function initForm() {
// Create a reference to the form timeline.
_global.form_mc = this;
// Create the LoadVars objects.
// One to send...
dataSender = new LoadVars();
// ...and one to receive.
dataReceiver = new LoadVars();
// Assign a callback function to the dataReceiver's onLoad handler.
// It will process the variables when they arrive.
dataReceiver.onLoad = function () {
// Prepare the response clip for data display.
form_mc.response.gotoAndStop("doneLoading");
// Display the value of output, the loaded variable, in the output_txt field.
form_mc.response.output_txt.text = this.output;
}
}
/*
* Function: submitForm()
* Desc: Retrieves user input and sends it to the server.
* Parameters: None.
*/
function submitForm () {
// Assign the value of input_txt to a property of dataSender. The escape()
// function encodes the & character to avoid network transfer errors.
dataSender.formInput = escape(input_txt.text);
// Display a loading message in the response clip.
form_mc.response.gotoAndStop("loading");
// Display what we're sending in the output window, for debugging purposes.
trace("Sending " + dataSender.toString());
// Send the properties of dataSender to the server, and wait for a reply.
dataSender.sendAndLoad("http://www.moock.org/cgi-bin/actionscriptbook/simpleEcho/echo.pl",
dataReceiver, "GET");
}
My question is how do I add to the form?