// create two new instances of LoadVars, one to send and one to receive data
var dataOut:LoadVars = new LoadVars();
var dataIn:LoadVars = new LoadVars();
// define what should happen when the response is received,
// using 'this' to refer to dataIn and get data from it
dataIn.onLoad = function() {
if (this.valid=="1") {
msg.text = 'Welcome. ' ;
} else {
msg.text = 'Sorry';
}
}
// the function that will be called by the Enter button
function checkUser():Void
{
dataOut.username = username.text;
dataOut.password = password.text;
dataOut.sendAndLoad("check.php", dataIn, "POST");
}
// define the behavior of the Enter button
enterbtn.addEventListener("click", checkUser);
PHP and flash
An example showing flash communicating with php and then back again to flash.
Actionscript 3.0 used.
iamthwee
iamthwee
iamthwee
iamthwee
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.