i did the changes and that error went went away only to give me another error at another spot. here is the code:
i put a mad face on the line where i am getting the error
1087: Syntax error: extra characters found after end of program.
protected function submit_appointment_clickHandler():void
{
var Sender:String = "";
var Email:String = "";
var HomePhone:String = "";
var CellPhone:String = "";
var Address:String = "";
var City:String = "";
var State:String = "";
var ZipCode:String = "";
var Comments:String = "";
var Interests:String = "";
var Type:String = currentState;
var evValidEmail:ValidationResultEvent = emailValidator.validate();
var evValidName:ValidationResultEvent = nameValidator.validate();
var evValidCellPhone:ValidationResultEvent = cellValidator.validate();
var evValidHomePhone:ValidationResultEvent = homeValidator.validate();
if (evValidEmail.type == ValidationResultEvent.VALID
&& evValidName.type == ValidationResultEvent.VALID
&& evValidCellPhone.type == ValidationResultEvent.VALID
&& evValidHomePhone.type == ValidationResultEvent.VALID)
{
resultLabel.text="Thank you.";
resultLabel.setStyle("styleName", "valid");
}
else
{
resultLabel.text="There are Form errors";
resultLabel.setStyle("styleName", "invalid");
}
}
switch(currentState)
{
case "appointment":
Sender = txtApptFirstName.text + " " + txtApptLastName.text;
Email = txtApptEmail.text;
HomePhone = txtApptHomePhone.text;
CellPhone = txtApptCellPhone.text;
Address = txtApptAddress.text;
City = txtApptCity.text;
State = txtApptState.text;
ZipCode = txtApptZipCode.text;
Comments = txtApptComments.text;
if(chkApptPhotography.selected) Interests = Interests + " Photography Session ";
if(chkApptChildrenFamily.selected) Interests = Interests + " Children and Family Portraits ";
if(chkApptPromSchool.selected) Interests = Interests + " Prom and School Event Photos ";
if(chkApptSeniorSchool.selected) Interests = Interests + " Senior School Photos ";
break;
case "contact":
Sender = txtContactFirstName.text + " " + txtContactLastName.text;
Email = txtContactEmail.text;
HomePhone = txtContactHomePhone.text;
CellPhone = txtContactCellPhone.text;
Address = txtContactAddress.text;
City = txtContactCity.text;
State = txtContactState.text;
ZipCode = txtContactZipCode.text;
Comments = txtContactComments.text;
if(chkContactPhotography.selected) Interests = Interests + " Photography Session ";
if(chkContactChildrenFamily.selected) Interests = Interests + " Children and Family Portraits ";
if(chkContactPromSchool.selected) Interests = Interests + " Prom and School Event Photos ";
if(chkContactSeniorSchool.selected) Interests = Interests + " Senior School Photos ";
break;
case "free_shoot":
Sender = txtFreeFirstName.text + " " + txtFreeLastName.text;
Email = txtFreeEmail.text;
HomePhone = txtFreeHomePhone.text;
CellPhone = txtFreeCellPhone.text;
Comments = txtFreeComments.text;
break;
}
emailService.send(
{
senderName: Sender,
senderEmail: Email,
senderHomePhone: HomePhone,
senderCellPhone: CellPhone,
senderAddress: Address,
senderCity: City,
senderState: State,
senderZipCode: ZipCode,
senderComments: Comments,
senderInterests: Interests,
sendType: Type
});
}
private function emailResult():void
{
Alert.show("Thank you for your submission. You will contacted shortly.");
clearForm();
}
private function clearForm():void
{
txtFreeFirstName.text="";
txtFreeLastName.text="";
txtFreeEmail.text="";
txtFreeHomePhone.text="";
txtFreeCellPhone.text="";
txtFreeComments.text="";
txtApptFirstName.text="";
txtApptLastName.text="";
txtApptEmail.text="";
txtApptHomePhone.text="";
txtApptCellPhone.text="";
txtApptAddress.text="";
txtApptCity.text="";
txtApptState.text="";
txtApptZipCode.text="";
txtApptComments.text="";
chkApptPhotography;
chkApptChildrenFamily;
chkApptPromSchool;
chkApptSeniorSchool;
txtContactFirstName.text="";
txtContactLastName.text="";
txtContactEmail.text="";
txtContactHomePhone.text="";
txtContactCellPhone.text="";
txtContactAddress.text="";
txtContactCity.text="";
txtContactState.text="";
txtContactZipCode.text="";
txtContactComments.text="";
chkContactPhotography;
chkContactChildrenFamily;
chkContactPromSchool;
chkContactSeniorSchool;
}