I'm making a simple PHP based email form that worked fine in Flash MX. I'm exporting as Flash 8 and authoring in Flash CS3.
Right now I have this AS2.0 in the first frame and it works fine:
Code:
stop();
function lineAdapt() {
message_send = message;
while (msg_count<length(message)) {
msg_count = msg_count+1;
if ((substring(message_send, msg_count, 2)) eq "\r") {
message_send = (substring(message_send, 1, msg_count-2)) + "\n" + (substring(message_send, msg_count+2, (length(message_send))-msg_count+2));
}
}
message = message_send;
delete msg_count;
delete message_send;
}
Then for my button I have:
Code:
on (release) {
if (from eq "" || subject eq "" || body eq "") {
gotoAndPlay(3);
} else {
lineAdapt();
loadVariablesNum("mail.php", 1, "POST");
gotoAndPlay(5);
}
}
Naturally my input fields variable names are set to those in the button AS. But whether the fields are full or empty the message sends. The only way to get this to work is if I name each field in both the variables and the instance name, but if I do that each field has this text in it when the form comes up:
_level0.instance8.from
_level0.instance8.subject
_level0.instance8.body
Anyone see what's going wrong? Like I said, this worked in Flash MX just fine.