Everyone,

I have a form that was created in Flash MX2004 Professional. The form is
located on a layer called form and startes on frame 10. The top layer is
called functions and on frame one of this layer I have a function like so.

fieldCheck = new LoadVars();
fieldCheck.onLoad = function(success){
if(success){
gotoAndStop("output");
}else{
errorMsg = "";
errorMsg = "Error!.";
gotoAndStop("error");
}
};

Ok, on frame 10 of the form layer is where I have my textbox and dropdown
box...etc. I created a button and on that buttons on(release) I have the code
that checks to see if entries are enter correctly and if so it will send the
variables to my asp page. Everything works greate except one thing. For some
reason this works fine and sometimes it does not. When I click send it sends
my email with no problem at all and goes to the output page. Ok, sometimes I
click send and it still sends my email but it goes to the error page. Can
anyone please fill me in on why this is happening to me. Thank you all in
advance.

code for the button:



on (release) {
var errorChk:Boolean;
if (school.selectedIndex == 0 || grade.selectedIndex == 0 || street.text ==
"" || city.text == "" || zip.text == "" || area.text == "" || exchange.text ==
"" || number.text == "") {
errorChk = true;
errMsg = "Please fill in the missing fields marked by an asterix '*'";
if (school.selectedIndex == 0) {
sReq = "*";
} else {
sReq = "";
}
if (grade.selectedIndex == 0) {
gReq = "*";
} else {
gReq = "";
}
if (street.text == "") {
stReq = "*";
} else {
stReq = "";
}
if (city.text == "") {
cReq = "*";
} else {
cReq = "";
}
if (zip.text == "") {
zipReq = "*";
} else {
zipReq = "";
}
if (area.text == "" || exchange.text == "" || number.text == "") {
pReq = "*";
} else {
pReq = "";
}
if (area.length<3) {
pReq = "*";
} else if (exchange.length<3) {
pReq = "*";
} else if (number.length<4) {
pReq = "*";
} else {
pReq = "";
}
} else {
errorChk = false;
sReq = "";
gReq = "";
stReq = "";
cReq = "";
zipReq = "";
pReq = "";
errMsg = "";
if (!errorChk) {
var program = _global.ptype;
var sInd = school.selectedIndex;
var gInd = grade.selectedIndex;
var obj = fieldCheck;
obj.school = school.getItemAt(sInd).data;
obj.grade = grade.getItemAt(gInd).data;
obj.street = street.text;
obj.city = city.text;
obj.zip = zip.text;
obj.area = area.text;
obj.exchange = exchange.text;
obj.number = number.text;
obj.notes = notes.text;
obj.program = program;
obj.sendAndLoad("upbound.asp", fieldCheck, "POST");
gotoAndStop("wait");
}
}
}