flash 与php 进行数据交互
我们用flash+php实现用户在flash中提交数据保存到mysql数据库哦。
System.useCodepage = true;
var user_an:Number;
if (select_1 && select_2 && select_3) {
user_an = 1;
} else {
user_an = 0;
}
var loginData = new LoadVars();
submit_send.onRelease = function() {
if (user_name.text == "" && user_tel.text == "") {
msga.text = "请输入正确的信息!";
} else {
//trace(user_name.text+user_tel.text+user_mail.text+user_an)
msga.text = "提交中...";
//trace("提交中");
loginData.user_name = user_name.text;
loginData.user_tel = user_tel.text;
loginData.user_mail = user_mail.text;
loginData.user_an = user_an;
loginData.sendAndLoad("add_save.php",loginData,"POST");
}// end else if
};
loginData.onLoad = function(success) {
if (success) {
if (loginData.submit == "true") {
user_name.text = "";
user_tel.text = "";
user_mail.text = "";
msga.text = "发送成功!";
} else {
msga.text = "提交失败,请重新提交";
}
} else {
trace("连接网络失败");
msga.text = "连接网络失败";
}
};
补充:flash教程,动画技术