MX sendAndLoad Question
- Started
- Last post
- 4 Responses
- loahn™
I have a pretty good grasp of flash actionscript but today, I've been vexing over LoadVars' sendAndLoad function.
I have:
function do_login() {
login = new LoadVars();
login.pass = pass_text;
login.user = name_text;
login.sendAndLoad("check.asp?che... this);
login.onLoad = function(success) {
if (success) {
if (msg_returned == "true") {
trace("login successful");
} else {
trace("login failed");
}
}
};
}So when a button is pressed, it calls the do_login function but it doesn' seem to do what I need it to do which is to return a variable (msg_returned) back to flash file and do more things...
Is this the correct usage of sendAndLoad?
Is the string that is sent to the ASP file incorrect (i have tested the same string with getURL and it does pass the correct information)?
Can i use login.onLoad in this way after login.sendAndLoad?
Sorry its poorly explained. My brain is completely fried today!
Any thought would be much appreciated.
- unfittoprint0
I use to work with Flash and PHP and once I had to use the escape fuction to urlencode the each variable within the LoadVars string. I thinks this was because of some characters (?).
- ********0
ahhh two of my favorites, Loahn and Unfit. :)
- _b_0
sendAndLoad/LoadVars doesn't require you to append the variables to the url string,
just use:login.sendAndLoad("check.asp", this);
and it will append the variables itself.
- kinetic0
if you are checking a var returned from your ASP script make sure you reference it proper.
if (myLoadVarsObject.myVarFromAsp == "good var") {
// everything is good } else {
// everything is bad }