talkToDB = function (email, messageBox) {
// set up LoadVars Object
lv = new LoadVars();
// this function is triggered when the data is sent back from DB
lv.onLoad = function() { displayReturned(this.email, this.messageBox);
};
// format datastring and send to database
lv.email = email;
lv.messageBox = messageBox;
lv.sendAndLoad(DBPATH, lv, 'POST');
};
displayReturned = function (email, messageBox) {
// show data returned from PHP script
returnedEmail.text = email;
returnedMessage.text = messageBox;
};
//path to php script & database
_global.DBPATH = 'http://www.wangbar.co.uk/php/get_tektips.php';
//button event
sendButton.onRelease = function() {
talkToDB(yourEmail.text, yourMessage.text);
};
//
stop();