Working with Flash CS4 - and a Newbie to actionscript.
Heres my Compiler Errors…. (description & source)
- Description…
1120: Access of undefined property locator_txt.
Go to source…
variables.loca = locator_txt.text;
- Description…
Warning: 3596: Duplicate variable definition.
Go to source…
var varLoader_re:URLLoader = new URLLoader;
stop();
//email_txt.tabIndex = 1;
//locator_txt.tabIndex = 2;
//sumbit_btn.tabIndex = 3;
////////////
// Assign a variable name for our URLVariables object
var variables:URLVariables = new URLVariables();
// Build the varSend variable
var varSend:URLRequest = new URLRequest(“http://www.myglobalpnr.com/scripts/ckin.php”);
varSend.method = URLRequestMethod.POST;
varSend.data = variables;
// Build the varLoader variable
var varLoader_re:URLLoader = new URLLoader;
varLoader.dataFormat = URLLoaderDataFormat.VARIABLES;
varLoader.addEventListener(Event.COMPLETE, completeHandler);
// Handler for PHP script completion and return
function completeHandler(event:Event):void{
status_txt.text ="";
if (event.target.data.return_msg == “no_good”) {
status_txt.text = “No reservation was found in our records, please try again”;
} else if (event.target.data.return_msg == “all_good”) {
var reloadPage:URLRequest = new URLRequest(“javascript:NewWindow=window.location.reload(); NewWindow.focus(); void(0);”);
navigateToURL(reloadPage, “_self”);
}
}
// Add an event listener for the submit button and what function to run
submit_btn.addEventListener(MouseEvent.CLICK, ValidateAndSend);
// Validate form fields and send the variables when submit button is clicked
function ValidateAndSend(event:MouseEvent):void{
// “Remember Me” addition code for the checkbox variable------------
var rememberChoice:String;
////////////////// remember me variable setup/////////////
if (rememberCheckbox.currentFrame == 2) {
rememberChoice = “Yes”;
} else {
rememberChoice = “No”;
}
// End “Remember Me” addition code for the checkbox variable-------
status_txt.text ="";
//validate form fields
if(!email_txt.length) {
status_txt.text = “Please enter your eMail address.”;
} else if(!locator_txt.length) {
status_txt.text = “Please enter your locator.”;
} else {
// Ready the variables for sending
variables.email = email_txt.text;
variables.loca = locator_txt.text;
variables.remember = rememberChoice; // Added for Remember me checkbox
// Send the data to the php file
varLoader.load(varSend);
status_txt.text = “Processing…”;
} // close else after form validation
} // Close ValidateAndSend function //////////////////////////////////////////////////////////////
Thanks in advance,
Scotty13:hair: