flash data integration:
I have a contact form which I need help with, basically the script below
incorporates a component button cbtSend. I need some help transferring the cbt
button into a custom button, ive tried just deleting the button and putting a
on release function but alas no look. Any help with be awesome
many thanks
import mx.utils.Delegate;
var cbtSend:mx.controls.Button;
var tFromEmail:TextField;
var tFromName:TextField;
var tComments:TextField;
var lvSend:LoadVars;
var lvReceive:LoadVars;
var sUrl:String = "http://www.phplocationhere.com";
function sendComments(oEvent:Object):Void {
lvSend = new LoadVars();
lvReceive = new LoadVars();
lvReceive.onLoad = function(bSuccess:Boolean):Void {
if (bSuccess && this.success == "1") {
gotoAndStop("output");
} else {
gotoAndStop("error");
}
};
lvSend.fromEmail = tFromEmail.text;
lvSend.fromName = tFromName.text;
lvSend.body = tComments.text;
lvSend.sendAndLoad(sUrl, lvReceive, "POST");
gotoAndStop("wait");
}
cbtSend.addEventListener("click", Delegate.create(this, this.sendComments));
focusManager.defaultPushButton = cbtSend;
stop();