PDA

View Full Version : Other dynamic text boxes needed?


SteveH
01-24-2008, 02:03 PM
Hello

I have the following in an FLA file (MX 2004). It sends the data from an online form to the Webmaster. If the data is sent, the server informs Flash that all is well and a couple of graphics tells the site visitor that his details have been sent. Two dynamic text boxes, one with an instance name of errTitle and another with the instance name of errType display this.

This is where the 'Thank You.' and 'Your message has been succesfully sent' come into play.

However, they are the only graphics I have. My question is what if the message is not sent? There is provision for this in the script below in which case another two graphics are supposed to pop up when the server informs Flash that the message has not been sent: "Error!" and "An error has occurred. Please try again later.".

Do I need to create more graphics to display these messages and, if so, where? Can I create them on another layer, or does it have to be on the same layer? Do I use any AS in the AS panel? And what about the instance names? Do I give the new 'fail' graphics the same instance names as I have for the two 'sent' graphics?

Many thanks for any help.

Steve


on (release) {

//Import variables to be sent

name = _root.name_txt.text
email = _root.email_txt.text
business = _root.business_txt.text
country = _root.country_txt.text
message = _root.message_txt.text

loadVariables("flash.asp",this,"POST");

//When Flash receives an answer from the server...

this.onData = function() {

//Move to the next frame

_root.nextFrame();
if(this.output=='sent') {

//If successful...

_root.errTitle = 'Thank You.';
_root.errType = "Your message has been succesfully sent.";

}
else
{

//and if not successful...

_root.errTitle = "Error!";
_root.errType = "An error has occurred. Please try again later.";

}
}
}