all groups > flash data integration > april 2007 >
You're in the

flash data integration

group:

I need help with php form


I need help with php form j_co
4/7/2007 12:00:00 AM
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();
Re: I need help with php form MotionMaker
4/8/2007 6:58:05 PM
If you are talking about a Flash Button Symbol or even a Flash MovieClip Symbol
you can do something like this

my_btn.onRelease = Delegate.create(this, this.sendComments);
my_mc.onRelease = Delegate.create(this, this.sendComments):
AddThis Social Bookmark Button